diff --git a/CLAUDE.md b/CLAUDE.md index 54f7d86..72fb226 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -27,39 +27,48 @@ The Docker dev server runs at **http://localhost:8081** (mapped from container p The site is structured around Trip entities. Key facts: - Active trip is set in `user/config/site.yaml` → `active_trip: japan-korea-2026` - Trip pages live at `user/pages/01.trips//` -- Each trip has: `01.dailies/`, `02.map/`, `03.stats/`, `04.stories/` +- Each trip has two content subfolders: `01.dailies/` (journal entries) and `04.stories/` (stories). The former `02.map/` and `03.stats/` standalone views were **removed** (2026-07-04, see `docs/working/plans/2026-07-04-standalone-page-cleanup.md`) — map and stats now render inline on the trip page +- `01.dailies/` and `04.stories/` are `routable:false` **data containers** — visiting `/trips//dailies` or `/stories` directly 404s/redirects; their children (entries/stories) render at their own detail URLs and are aggregated by the trip page - 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. This filter bar + stats chrome is shared with the home active-trip view via the `trip-feed-col` partial (see "Shared trip-feed-col partial" below) -- 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 +- The trip page (`trip.html.twig`) uses a **client-side filter bar** (All content / Journal / Stories). The standalone `/dailies`, `/map`, `/stats`, `/stories` view pages no longer exist — do NOT try to re-create them or link to them. This filter bar + stats chrome is shared with the home active-trip view via the `trip-feed-col` partial (see "Shared trip-feed-col partial" below) +- Stats are shown inline on the trip page via a toggle (the standalone `/stats` view was removed) +- GPX route files live as media on the trip page itself, parsed client-side via toGeoJSON (bundled into `js/map.js`) and drawn on the trip/home map - Manage GPX files (view/upload/delete) at `/gpx-manager` — requires admin login; filenames are auto-slugified on upload -### Shared feed-map partial +### One map path: `MapUtils.initEntryMap` + the `entry-map` partial -The mini-map above the feed is shared across two pages via a Twig partial: +There is a **single** map code path on the site. The engine is `MapUtils.initEntryMap(opts)` in `js/src/maplibre-utils.js` (bundled into `js/map.js` via `make build-assets` — never hand-edit `js/map.js`). It builds the MapLibre map, places markers/popups, fits bounds, draws the GPX journey, and wires the fullscreen toggle. -- **Partial:** `user/themes/intotheeast/templates/partials/feed-map.html.twig` -- **Used by:** `dailies.html.twig` and `stories.html.twig` -- **NOT used by:** `trip.html.twig` (uses its own `#trip-map` / `.home-map-col` layout) +The map **markup + invocation** is shared via one partial: -**Parameters (passed via `{% include ... with {...} only %}`):** +- **Partial:** `user/themes/intotheeast/templates/partials/entry-map.html.twig` +- **Used by:** `trip.html.twig` and the active branch of `home.html.twig` (both via `{% include ... with {...} only %}`) -| Parameter | Type | Description | -|---|---|---| -| `map_entries` | array | `[{lat, lng, title, slug, url, type, force_connect, transport_mode}]` | -| `map_id` | string | HTML id for map div: `'feed-map'` or `'stories-map'` | -| `map_var` | string | JS global variable: `'feedMap'` or `'storiesMap'` | -| `link_href` | string\|null | "View full map" link URL; `null` hides it | -| `card_prefix` | string | Scroll-to ID prefix: `'entry-'` (dailies) or `'story-'` (stories) | -| `trip_page` | Page | Trip page object for autoconnect setting | -| `show_journey` | bool | `true` draws the route connector; `false` skips it | +It renders the `.home-map-col` column (map div `#{{ map_id }}` + fullscreen button) and, when `entries` is non-empty, a thin `