Editing Safely
Skill level: Complete beginner
Nothing you change in Lotline 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: yellow
[business]or[forms]lines point at a value to fix. - Make the window narrow to see the phone layout. Open the mobile menu and check the property cards and the search.
- 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 "Add the Maple Row listing and new office hours"- 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 Lotline 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: most sections have several layouts, and every page can override a section with a named block - save a checkpoint
- run
npm run astro-checkafterwards
Edit Listings With Care
Listings, agents, developments, and neighborhoods are linked by file name. A few habits keep those links working:
- Give a new listing the same file name in every language folder. The file name is the page address, and
npm run check-i18nfails when a file exists in one language only. - Don’t rename a file that others point at. If you rename
omar-reyes.md, every listing withagent: "omar-reyes"loses its agent card, and there is no error. Search the project for the old name first. - Keep prices plain numbers (
615000, monthly for rentals). The theme writes the currency and separators from[listings]. - Check the photo paths. A path that points at a missing file shows nothing. Open the property page after you add photos.
- Hide a sold or let home with
draft: trueinstead of deleting the file, so you can bring it back. If it is the featured card in the Properties menu, change that card too.
Run The Checks
npm run astro-check # finds mistakes in code, translations, and content files that have a schemanpm run build # builds the full site, as your host willRun both before every deploy. Stop npm run dev first, and run them one after the other, not at the same time.
astro-check doesn’t check the section files or the contact page file, and it doesn’t notice an agent or neighborhood value that matches no file. 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 the placeholder, and [forms] means a form still posts to a placeholder address.