From 6d2723e6f2383eb0b09454409a22dbcaa5e06e4d Mon Sep 17 00:00:00 2001 From: Mischa Date: Sun, 21 Jun 2026 11:10:24 +0200 Subject: [PATCH] docs: move template behaviour to README; remove from CLAUDE.md --- CLAUDE.md | 1 - README.md | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 199438e..07a2cd6 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -31,7 +31,6 @@ The site is structured around Trip entities. Key facts: - Site nav in `base.html.twig` has Home + Past Trips only — does not link to trip sub-sections - Post form parent (`post-form.md` → `pageconfig.parent`) **must be kept in sync** with `active_trip` - The trip page (`trip.html.twig`) uses a **client-side filter bar** (All content / Journal / Stories) — do NOT add nav links back to `/dailies`, `/stats`, `/stories` on the trip page -- **Sort order is intentionally different per context:** `trip.html.twig` sorts ascending (`sort_by_key('date', 4)`) so the trip reads chronologically from start to finish; `home.html.twig` active-trip mode sorts descending (`sort_by_key('date', 3)`) so the latest entry appears first - Stats are shown inline on the trip page via a toggle; the standalone `/stats` sub-page still exists as a URL but is not linked from the trip page - 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 diff --git a/README.md b/README.md index 1414679..e48e41c 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,26 @@ Plugins are not committed to git. The full list is in `plugins.txt` — one plug --- +## Template behaviour + +Key design decisions that affect how pages render: + +| Context | Sort order | Reason | +|---------|------------|--------| +| Trip page (`trip.html.twig`) | Ascending (oldest first) | Trip reads as a narrative from start to finish | +| Homepage active-trip feed (`home.html.twig`) | Descending (newest first) | Visitors want to see what's happening right now | + +**Homepage modes** — controlled by `travelling` in `user/config/site.yaml`: + +| `travelling` | Homepage shows | +|---|---| +| `true` | Active trip map + chronological feed (newest first) | +| `false` | Map with highlight markers + curated highlights grid (max 6, 1 per trip, random) | + +Entries and stories opt into the highlights grid via `featured: true` in their frontmatter. The `active_trip` field stores a full page route (e.g. `/trips/italy-2026-demo`), not a bare slug. + +--- + ## Security - `.env` is gitignored. Never commit it — it contains your server credentials and Gitea token.