Editing Safely
Skill level: Complete beginner
Nothing you change in Covena is permanent if you keep checkpoints. These habits make every edit safe to try, whether you edit by hand or with AI.
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. Watch the terminal too: an error or a yellow warning points at the file to fix.
- Make the window narrow to see the phone layout, and open the mobile menu. Longer names and labels show their problems here first.
- Check your other languages: open the same page under
/fr/and/ar/. Each language reads its own folder, so change each one. Arabic pages read right to left. - Save a checkpoint when it works (see below).
- Repeat.
Small steps make problems easy to find: if the page breaks, it was the last change.
Save Checkpoints With Git
In VS Code’s Source Control panel (or the terminal):
git add .git commit -m "Change office hours and hero text"- See what changed since the last checkpoint: click a file in the Source Control panel. 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 Covena project folder (without node_modules/) before a big change, and name the copy with the date.
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/, src/lib/, or src/styles/:
- check whether the change can be made in a content file or
config.tomlinstead. It usually can: a page can change any of its sections with a named block, hide one withenable: false, and pick its header and footer in its page file - save a checkpoint
- run
npm run astro-checkafterwards
Edit Slugs With Care
Files point at each other by slug, the file name without .md. An attorney’s office names an office file, a practice area’s relatedAttorneys lists attorney files, and a result’s practice and attorneys do the same. When you rename or delete an entry:
- rename or delete it in every language folder (
english,french,arabic) - search the project for the old slug and update every list that names it. For most of these lists, the build prints a
No entry namedwarning when a slug has no file - check the menus in
src/config/menu.<lang>.json, which link to pages by address
Keep The Results Disclaimer
Every result card and result page shows “Past results do not guarantee a similar outcome. Every case is different.” from results.disclaimer in src/i18n/<lang>.json. You can reword it in each language, but don’t empty it, and keep it next to any past outcome you add elsewhere.
Run The Checks
npm run astro-check # finds mistakes in code and in content files that have a schemanpm run build # builds the full site, as your host willnpm run verify # every check: astro-check, tests, formatting, build, links, languagesRun astro-check and build before every deploy, and verify after bigger changes. Stop npm run dev first, and run the commands one after the other, not at the same time.
astro-check doesn’t catch a misspelled option in a section file or a page block with a wrong name, so the safe editing loop above (look at the page after each change) is your check for those. Read the yellow lines in the npm run build output: [site] means baseUrl is still empty.