docs: trim CLAUDE.md 305->179 lines; extract code descriptions to docs/
CLAUDE.md is loaded into context on every request, so every line has a recurring cost. Applies one rule to decide what earns its place: keep what changes behaviour (rules and gotchas Claude cannot discover before it acts); extract what merely describes code (Claude reads the code anyway, and prose about code silently drifts). The four stale facts fixed in the previous commit were all in the "describes code" class -- active_trip, the Admin2 version, demo-load's scope, the gitignore list. None were rules. That is the argument for moving this material next to what it documents. Extracted (kept as pointers): - entry-map + trip-feed-col parameter contracts (56 lines) -> reference/ architecture.md "Shared partial contracts". CLAUDE.md keeps only the invariants: single map path, must assign window.tripMap/homeMap, keep trip-feed-col single-purpose, initTripStats depends on MapUtils. - Prod override runbook (49 -> 9 lines) -> guides/deploy-cycle.md "The env override tree", incl. the Twig dev/prod table and WEB_HOST. CLAUDE.md keeps the two behavioural rules: never commit prod values, and Admin on the server writes to the env tree (so check both config paths, env wins). - GPX API routes, session auth and the Blob/FormData upload gotcha -> guides/gpx-manager.md "How the manager is wired". - Trip-switch procedure -> guides/trip-switching.md. CLAUDE.md keeps the one rule that matters: never re-add pageconfig.parent to post-form.md. - Also trimmed the dev-command table and custom-plugin table added in the previous commit; both largely restated the Makefile and blueprints. Fixed the guides being pointed into, so the pointers lead to truth: - trip-switching.md instructed editing a pageconfig.parent that no longer exists -- its whole "two files must be updated together" premise was obsolete and would have reintroduced the desync it warned about. - architecture.md: Grav 2.0.4->2.0.7, Admin2 2.0.10->2.0.12, corrected the posting pipeline to show cache-on-save injecting parent before the write, added entry-actions to the custom-plugin list. - japan-korea-2026 -> denmark-2026 across guides/reference (docs/solutions keeps its historical references intact -- those are incident records). Verified: every markdown link resolves, every referenced section heading exists, and each extracted item was confirmed present in its new home. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
# Switching to a New Trip
|
||||
|
||||
When you start a new trip, **two files must be updated together** — if only one is changed, new entries will be posted to the wrong folder silently (no error, wrong trip).
|
||||
The active trip lives in **one** place: `user/config/site.yaml` → `active_trip`. Set it, create the new page tree, push.
|
||||
|
||||
> **Changed 2026-07:** this used to require editing two files in lockstep (`site.yaml` **and** `post-form.md` → `pageconfig.parent`), and they silently desynced. The `cache-on-save` plugin now derives the write target from `site.active_trip` at submit time (`onFormValidationProcessed` → `setData('parent', …)`), so `post-form.md` no longer carries a `parent` at all. **Do not re-add one** — it would override the derived target and reintroduce the desync.
|
||||
|
||||
---
|
||||
|
||||
## Checklist
|
||||
|
||||
- [ ] Update `user/config/site.yaml` → `active_trip`
|
||||
- [ ] Update `user/pages/02.post/post-form.md` → `pageconfig.parent`
|
||||
- [ ] Create the new trip page tree (see below)
|
||||
- [ ] Run `make content-push` to push the changes to production
|
||||
|
||||
@@ -15,38 +16,28 @@ When you start a new trip, **two files must be updated together** — if only on
|
||||
|
||||
## Step 1 — Update site.yaml
|
||||
|
||||
In `user/config/site.yaml`, set `active_trip` to the new trip slug:
|
||||
In `user/config/site.yaml`, set `active_trip` to the new trip's **route**:
|
||||
|
||||
```yaml
|
||||
active_trip: japan-korea-2026 # ← change this
|
||||
active_trip: /trips/denmark-2026 # ← change this
|
||||
```
|
||||
|
||||
The slug must exactly match the folder name under `user/pages/01.trips/`.
|
||||
The final segment must exactly match the folder name under `user/pages/01.trips/`.
|
||||
|
||||
You can also set this from Admin → Configuration → Site → **Active Trip** (a page-picker rooted at `/trips`; blueprint at `user/blueprints/config/site.yaml`).
|
||||
|
||||
> `system.yaml` → `home.alias` is permanently `/home` (the real home page) and does **not** change when switching trips.
|
||||
|
||||
---
|
||||
|
||||
## Step 2 — Update post-form.md
|
||||
|
||||
In `user/pages/02.post/post-form.md`, set `pageconfig.parent` to the new dailies path:
|
||||
|
||||
```yaml
|
||||
pageconfig:
|
||||
parent: /trips/japan-korea-2026/dailies # ← change this
|
||||
```
|
||||
|
||||
**Why both?** Grav's config and page frontmatter are static YAML — no variable substitution is possible, so `post-form.md` can't read from `site.yaml` automatically. They must match manually.
|
||||
|
||||
**What breaks if they're out of sync:** `active_trip` controls which trip page is featured on the home page and trip page. `pageconfig.parent` controls where new entries land. If they differ, new posts go to the old trip's dailies folder while the home page shows the new trip — entries appear to vanish.
|
||||
|
||||
---
|
||||
|
||||
## Step 3 — Create the new trip page tree
|
||||
## Step 2 — Create the new trip page tree
|
||||
|
||||
Create the two content subfolders under `user/pages/01.trips/<new-slug>/`:
|
||||
|
||||
```
|
||||
user/pages/01.trips/japan-korea-2026/
|
||||
user/pages/01.trips/denmark-2026/
|
||||
├─ trip.md ← title, date_start, date_end, cover_image, album_url
|
||||
├─ *.gpx ← route files (optional; page media, auto-detected)
|
||||
├─ 01.dailies/
|
||||
│ └─ dailies.md ← inert container: template: default, routable: false, visible: false
|
||||
└─ 04.stories/
|
||||
@@ -55,13 +46,13 @@ user/pages/01.trips/japan-korea-2026/
|
||||
|
||||
Copy these files from an existing trip and update the frontmatter (especially `title` and `date_start` in `trip.md`).
|
||||
|
||||
> The `02.map/` and `03.stats/` standalone views were retired (2026-07-04) — the map and stats render inline on the trip page. The `01.dailies/` and `04.stories/` folders now exist only as data containers holding the entry/story children; their own routes are non-routable.
|
||||
> The `02.map/` and `03.stats/` standalone views were retired (2026-07-04) — the map and stats render inline on the trip page. The `01.dailies/` and `04.stories/` folders now exist only as data containers holding the entry/story children; their own routes are non-routable. Do **not** recreate `02.map/` or `03.stats/`.
|
||||
|
||||
Fields in `trip.md` to update:
|
||||
|
||||
| Field | Example | Notes |
|
||||
|---|---|---|
|
||||
| `title` | `Japan & Korea 2026` | Displayed in nav and trip header |
|
||||
| `title` | `Denmark 2026` | Displayed in nav and trip header |
|
||||
| `date_start` | `2026-07-15` | Used for "X days on the road" stat |
|
||||
| `date_end` | *(leave blank while travelling)* | Set when you return |
|
||||
| `cover_image` | `cover.jpg` | Shown on the trips listing page |
|
||||
@@ -69,7 +60,7 @@ Fields in `trip.md` to update:
|
||||
|
||||
---
|
||||
|
||||
## Step 4 — Push
|
||||
## Step 3 — Push
|
||||
|
||||
```bash
|
||||
make content-push
|
||||
|
||||
Reference in New Issue
Block a user