Editing Safely
Skill level: Complete beginner
Nothing you change in Consultiz is permanent if you keep checkpoints. These habits make every edit safe to try, whether you edit by hand or with an AI assistant.
New to the file formats? Read Markdown And Frontmatter Basics and Config Basics in the common guide first.
The Safe Editing Loop
- Run the site with
npm run dev, so you see each change as soon as you save. - Change one thing, save, and look at the page.
- Check the phone layout by making the browser window narrow.
- Check the French page (
/fr/...) if you changed English text. - Save a checkpoint when it works (see below).
Small steps make problems easy to find: if the page breaks, it was the last change.
Save Checkpoints With Git
Before you change anything, save the untouched theme as your first version:
git initgit add .git commit -m "Consultiz as downloaded"Then, after each working change:
git add .git commit -m "Change banner text and brand color"- See what changed since the last checkpoint: in VS Code’s Source Control panel, click a file. Removed lines are red, added lines are green.
- Undo changes to one file: right-click it in Source Control and choose Discard Changes.
- Undo everything since the last checkpoint:
git restore .in the terminal.
No git? Copy the whole project folder (without node_modules/) before a big change, and name the copy with the date.
Keep YAML, TOML, And JSON Valid
- YAML (frontmatter): keep the
---lines, indent with spaces (never tabs), put text containing a:in quotes, and writetrueandfalsewithout quotes. A line starting with#is a comment. - TOML (
config.toml):key = value, text in quotes, and each key belongs to the[table]above it. - JSON (menus, i18n, fonts): double quotes around keys and text, a comma between items, and no comma after the last item.
Before You Change Code
Content files are hard to break. Components and styles are easier to break and harder to fix. Before you edit anything in src/layouts/ or src/styles/:
- check whether the change can be made in a content file or
config.tomlinstead (it usually can) - save a checkpoint
- run
npm run astro-checkafterwards
Run The Checks
npm run astro-check # finds mistakes in code and content filesnpm run build # builds the full site, as your host willRun both before every deploy. Stop npm run dev first. npm run verify runs these and the theme’s other checks in one go; see Installation.
Section files are only loosely checked, so the safe editing loop above (look at the page after each change) is your check for them. If npm run build prints a [site] warning, set baseUrl in config.toml before you deploy.