Installation Guide
Veltro uses npm, which comes with Node.js, and includes a package-lock.json. The Node.js version you need depends on your edition:
| Edition | Node.js version |
|---|---|
| Astro | 22.12.0 or later |
| Tina | 22 (22.23.4 or later) or 24. Tina’s command line tool supports only those two versions |
| Sanity | 22.12.0 or later |
Install Node.js
Install Node.js from nodejs.org, then verify it:
node -vInstall Node.js with Homebrew or the official installer:
brew install nodenode -vFor the Tina edition, Homebrew may give you a newer version than 24, so use the official installer if it does.
Install Node.js with your preferred package manager or the official installer, then verify it:
node -vYour package manager may give you an older version than the table above asks for. If it does, use the official installer.
Install Dependencies
Unzip the theme and open a terminal in its folder. In the Tina edition, that is the themes/veltro-tina folder inside the zip.
npm ciThis installs the exact dependency versions from package-lock.json.
Start Development
npm run devYour site is at http://localhost:4321. What happens next depends on your edition:
- Astro: this generates the settings file from
src/config/config.toml, watches that file for changes, and starts the site. Edit the files in your code editor. - Tina: this does the same, and also starts the editor. Open
http://localhost:4321/admin/and click Enter Edit Mode. You need no account and no password. See Tina. - Sanity: this does the same as the Astro edition, and the site runs with the bundled demo content, with no account. To edit it, run
npm run setupto connect your own Sanity project, thennpm run dev:all, and open the Studio athttp://localhost:3333. See Sanity.
If another program uses port 4321:
- Astro: run
npm run dev -- --port 4322. - Tina: set
PORT.TINA_GRAPHQL_PORTandTINA_DATALAYER_PORTmove the editor’s other two ports, 4001 and 9000. - Sanity: set
SITE_PORTin.env.STUDIO_PORTmoves the Studio from 3333.
Check, Test, And Build
Run these one at a time:
npm run astro-checknpm testnpm run buildThe production build regenerates the settings file, builds the static Astro site, removes draft pages from the sitemap, and writes the result to dist/. In the Sanity edition, it reads your published content, or the bundled demo content if no project is connected.
Preview A Production Build
npm run previewThe preview script performs a fresh build before starting Astro Preview.
Other Scripts
| Script | What it does |
|---|---|
format | Formats the files in src/ with Prettier |
test:watch | Runs the unit tests again when a file changes |
generate-favicons | Makes the favicon files from your source image. See Site Identity & Logo |
generate-multilingual-content | Adds a language. It needs the language’s details, and the flags differ by edition. See Internationalization |
remove-multilingual | Removes every language except your default one. See Internationalization first |
remove-draft-from-sitemap | Removes draft pages from the sitemap. build and preview run it for you |
deploy:cf | Runs wrangler pages deploy. Wrangler isn’t one of the theme’s dependencies, so install and configure it first |
Scripts Only In The Tina Edition
| Script | What it does |
|---|---|
tina:generate | Rebuilds the editor’s forms. Run it after you add a section, a field, or a language |
tina:audit | Tells you if a save in the editor would lose anything. Run it after you edit files by hand |
setup:tina | Walks you through online editing with your own Tina Cloud project. It’s optional |
Scripts Only In The Sanity Edition
| Script | What it does |
|---|---|
setup | Logs you in, creates your project, writes .env, and uploads the demo content |
dev:all | Starts the website and the Studio together |
studio | Starts the Studio on its own |
import-seed | Uploads the demo content again. It replaces documents with the same IDs. Add -- --missing to keep the documents you already have |
sanity:validate | Checks the Studio’s schema |
studio:build | Builds the Studio |
studio:deploy | Puts the Studio online |
build:preview | Builds the preview server for draft preview online |
start:preview | Starts the preview server |