diff --git a/CLAUDE.md b/CLAUDE.md index 4a9ac5a..199438e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -13,7 +13,7 @@ ### Current stack -- **Grav:** 2.0.0-rc.9 (installed manually — see §3 below) +- **Grav:** 2.0.0-rc.10 (baked into the custom Docker image via `Dockerfile`) - **Admin:** Admin2 v2.0.0-rc.15 (plugin slug: `admin2`, NOT `admin`) - **Docker image:** `getgrav/grav` with `GRAV_CHANNEL=beta` - **PHP session:** `session.save_path = /tmp` set in `php/php-local.ini` @@ -31,6 +31,7 @@ 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 @@ -108,7 +109,7 @@ Before going live, change in `user/config/system.yaml`: |---|---|---| | `twig.cache` | `true` | Templates compiled once and reused; safe because theme files don't change at runtime | -**Pre-launch smoke test required:** with `twig.cache: true`, submit one post via `/post` and confirm the entry appears in `/trips/japan-korea-2026/dailies` immediately. This verifies the cache-on-save plugin (BUG-001 fix) works correctly with caching enabled. +**Pre-launch smoke test required:** with `twig.cache: true`, submit one post via `/post` and confirm the entry appears in `/trips/italy-2026-demo/dailies` immediately. This verifies the cache-on-save plugin (BUG-001 fix) works correctly with caching enabled. ### What the cache-on-save plugin handles @@ -135,27 +136,11 @@ to ensure permissions are correct. ### Grav 2.0 upgrade (local) -GPM (`php bin/gpm selfupgrade`) does **not** serve Grav 2.0 RC — it still reports 1.7.x as latest even on the `testing` channel. To upgrade locally: +Grav 2.0 is baked into the custom Docker image via `Dockerfile`. The base `getgrav/grav` image ships 1.7 — the `Dockerfile` downloads the 2.0-rc.10 bundle from GitHub and overwrites the core files at build time, so the image always contains 2.0. -```bash -# Download grav-admin bundle (includes Grav core + admin2 plugin) -docker exec -w /tmp intotheeast_grav bash -c " - curl -sL 'https://getgrav.org/download/core/grav-admin/2.0.0-rc.9?testing' -o grav-admin.zip && \ - unzip -q grav-admin.zip -" -# Copy core files only (not user/) -docker exec -w /tmp intotheeast_grav bash -c " - cp -rf grav-admin/{assets,bin,system,vendor,webserver-configs,index.php,composer.json,composer.lock,robots.txt,CHANGELOG.md,LICENSE.txt} /var/www/html/ -" -# Install Admin2 from the bundle (it's named admin2, not admin) -docker exec -w /tmp intotheeast_grav bash -c " - cp -rf grav-admin/user/plugins/admin2 /var/www/html/user/plugins/admin2 -" -make fix-perms -docker exec -w /var/www/html intotheeast_grav php bin/grav cache --all -# Cleanup -docker exec intotheeast_grav rm -rf /tmp/grav-admin /tmp/grav-admin.zip -``` +`make setup` = `build → start → install-plugins → fix-perms`. After any `docker compose down`, run `make setup` to get back to a fully working state. `docker compose restart` (soft restart) also preserves the image, so Grav 2.0 stays. + +To upgrade to a newer RC: update the URL in `Dockerfile` and run `make setup` — Docker rebuilds the image layer automatically. After upgrading, ensure these settings in `user/config/system.yaml`: ```yaml