{{ entry.title }}
+{{ entry.summary|striptags|slice(0, 250)|trim }}
+ Read entry → +diff --git a/docs/superpowers/plans/2026-06-19-home-and-trip-pages.md b/docs/superpowers/plans/2026-06-19-home-and-trip-pages.md new file mode 100644 index 0000000..68659fe --- /dev/null +++ b/docs/superpowers/plans/2026-06-19-home-and-trip-pages.md @@ -0,0 +1,1049 @@ +# Home Page & Content Flow Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Replace the redirect-based home page with a real side-by-side map + feed home page, add a past-trips archive, add story cards to all feeds, and enrich the trip page with a sticky sidebar index. + +**Architecture:** Pure Twig + CSS. New `home.html.twig` template for the home page; updated `trips.html.twig`, `trip.html.twig`, `dailies.html.twig`, `stories.html.twig`. All feeds merge journal entries and story entries into one chronological collection sorted descending by date. Leaflet map on the home page reuses the same CDN setup as `dailies.html.twig`. + +**Tech Stack:** Grav CMS 2.0 (Twig 3), Vanilla CSS (custom properties from `tokens.css`), Leaflet.js 1.9.4 via CDN + +## Global Constraints + +- All template/theme changes committed via `git -C user` (the `user/` dir is a separate git repo) +- No new Grav plugins, no JS framework, no build pipeline +- Existing CSS token names in `tokens.css` must not change — only new rules added to `style.css` +- Theme dir: `user/themes/intotheeast/` +- Active trip slug: `config.site.active_trip` (set in `user/config/site.yaml`) +- Dev server: `http://100.96.115.96:8081` — twig.cache is false, changes take effect immediately +- All commits use `git -C /home/mischa/Nextcloud/Projects/travel-blog-intotheeast/user` + +--- + +### Task 1: Home page routing + nav + +**Files:** +- Create: `user/pages/00.home/home.md` +- Modify: `user/config/system.yaml` (line 31: `home.alias`) +- Modify: `user/themes/intotheeast/templates/partials/base.html.twig` + +**Interfaces:** +- Produces: `/` serves a real page (not redirect); nav shows "Home" + "Past Trips"; `{% block nav %}` is overridable by child templates + +- [ ] **Step 1: Create the home page directory and markdown file** + +```bash +mkdir -p /home/mischa/Nextcloud/Projects/travel-blog-intotheeast/user/pages/00.home +``` + +Write `user/pages/00.home/home.md`: +```markdown +--- +title: Home +visible: false +routable: true +--- +``` + +- [ ] **Step 2: Change home.alias in system.yaml** + +In `user/config/system.yaml`, find line 31: +```yaml +home: + alias: /trips/japan-korea-2026/dailies +``` +Replace with: +```yaml +home: + alias: /home +``` + +- [ ] **Step 3: Update base.html.twig — nav + body class + block nav** + +Replace the entire content of `user/themes/intotheeast/templates/partials/base.html.twig` with: + +```twig + + +
+ + +No trips yet.
+{% else %} +{{ entry.summary|striptags|slice(0, 250)|trim }}
+ Read entry → +No entries yet. The journey is about to begin.
+ {% endif %} ++ {{ page.header.date_start|date('d M Y') }} + {% if page.header.date_end %} — {{ page.header.date_end|date('d M Y') }}{% endif %} +
+ {% endif %} ++ {{ journal_count }} journal {{ journal_count == 1 ? 'entry' : 'entries' }} + {% if story_count > 0 %} · {{ story_count }} {{ story_count == 1 ? 'story' : 'stories' }}{% endif %} +
+{{ entry.summary|striptags|slice(0, 250)|trim }}
+ Read entry → +No entries yet. The journey is about to begin.
+ {% endif %} +{{ entry.summary|striptags|slice(0, 250)|trim }}
+ Read entry → +No entries yet. The journey is about to begin.
+ {% endif %} +Stories coming soon.
+{% endblock %} +``` + +- [ ] **Step 3: Verify dailies feed** + +```bash +curl -s http://100.96.115.96:8081/trips/japan-korea-2026/dailies | grep -o 'id="entry-\|entry-card--story\|story-badge' +``` +Expected: `id="entry-` present (cards have anchor IDs). `entry-card--story` and `story-badge` present only if story pages exist. + +- [ ] **Step 4: Verify stories escape link** + +First check if a story page exists (otherwise create a test one). If stories exist: +```bash +curl -s http://100.96.115.96:8081/trips/japan-korea-2026/stories | grep -o 'story-escape\|site-nav' +``` +Expected: `story-escape` present, `site-nav` absent. + +- [ ] **Step 5: Commit** + +```bash +git -C /home/mischa/Nextcloud/Projects/travel-blog-intotheeast/user add themes/intotheeast/templates/dailies.html.twig themes/intotheeast/templates/stories.html.twig +git -C /home/mischa/Nextcloud/Projects/travel-blog-intotheeast/user commit -m "feat: dailies merges stories, id attrs for map sync; stories escape link" +``` + +--- + +## Self-Review + +**Spec coverage check:** +- §1 URL structure — Task 1 (home.md, system.yaml) ✓ +- §2 Home page layout + data + map — Task 4 ✓ +- §2 Mobile stack — Task 2 CSS media query ✓ +- §3 Past trips archive with counts — Task 3 ✓ +- §4 Trip page counts + sidebar + merged feed — Task 5 ✓ +- §5 Story cards in feeds (home + trip + dailies) — Tasks 4, 5, 6 ✓ +- §5 Story card visual treatment (teal border, badge) — Task 2 CSS ✓ +- §6 Nav updated to Home + Past Trips — Task 1 ✓ +- Stories escape link / nav override — Task 6 ✓ + +**Placeholder scan:** None found. + +**Type consistency:** `entry.slug` used consistently for `id="entry-{{ entry.slug }}"` in Tasks 4, 5, 6. Map entries use `slug` field for scroll target in Tasks 4, 6. All match.