docs: update trip-switching checklist — home.alias is now permanent /home
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RB86BaJBG3eGiMdfhmHRrQ
This commit is contained in:
@@ -27,6 +27,36 @@ The site is structured around Trip entities. Key facts:
|
|||||||
- Nav in `base.html.twig` derives all links from `config.site.active_trip`
|
- Nav in `base.html.twig` derives all links from `config.site.active_trip`
|
||||||
- Post form parent (`post-form.md` → `pageconfig.parent`) **must be kept in sync** with `active_trip`
|
- Post form parent (`post-form.md` → `pageconfig.parent`) **must be kept in sync** with `active_trip`
|
||||||
- GPX route files live as media on the trip page itself, served via leaflet-gpx CDN
|
- GPX route files live as media on the trip page itself, served via leaflet-gpx CDN
|
||||||
|
- Manage GPX files (view/upload/delete) at `/gpx-manager` — requires admin login; filenames are auto-slugified on upload
|
||||||
|
|
||||||
|
### GPX file management
|
||||||
|
|
||||||
|
GPX files are stored as page media on the trip page (`user/pages/01.trips/<slug>/`). They are picked up automatically by `map.html.twig` via `trip_page.media.all`.
|
||||||
|
|
||||||
|
The GPX manager page (`user/pages/03.gpx-manager/`) provides a browser UI at `/gpx-manager`:
|
||||||
|
- **Auth:** enforced by Login plugin via `access.admin.login: true` in frontmatter — shows login form if not authenticated
|
||||||
|
- **Template:** `user/themes/intotheeast/templates/gpx-manager.html.twig`
|
||||||
|
- **API:** uses Grav API v1 with session cookie auth (`session_enabled: true` in `user/plugins/api/api.yaml`)
|
||||||
|
- List: `GET /api/v1/pages{route}/media`
|
||||||
|
- Upload: `POST /api/v1/pages{route}/media` (multipart)
|
||||||
|
- Delete: `DELETE /api/v1/pages{route}/media/{filename}`
|
||||||
|
- **Slugification:** filenames are slugified client-side before upload (spaces/special chars → hyphens, lowercase); the file is sliced to a plain `Blob` so the third argument to `FormData.append` is always used as the filename
|
||||||
|
- **Media type:** `.gpx` is registered in `user/config/media.yaml` so Grav serves and tracks these files
|
||||||
|
|
||||||
|
To add GPX files without the browser UI, drop them directly into `user/pages/01.trips/<slug>/` and run `make content-push`.
|
||||||
|
|
||||||
|
### Switching to a new trip
|
||||||
|
|
||||||
|
Two places hardcode the active trip slug. Grav's config and page frontmatter are static YAML — no variable substitution is possible, so these cannot read from `site.yaml` automatically. **Both must be updated together** when starting a new trip, or entries will be posted to the wrong folder.
|
||||||
|
|
||||||
|
| File | Key | Example value |
|
||||||
|
|---|---|---|
|
||||||
|
| `user/config/site.yaml` | `active_trip` | `italy-2027` |
|
||||||
|
| `user/pages/02.post/post-form.md` | `pageconfig.parent` | `/trips/italy-2027/dailies` |
|
||||||
|
|
||||||
|
Note: `system.yaml` `home.alias` is permanently set to `/home` (the real home page) and does **not** need to change when switching trips.
|
||||||
|
|
||||||
|
After updating, also create the new trip's page tree under `user/pages/01.trips/<new-slug>/` with the standard four subfolders.
|
||||||
|
|
||||||
### Environment
|
### Environment
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user