From 66c7c0b014a7262ac09bf0e301a57d3200481dbd Mon Sep 17 00:00:00 2001 From: Marcos Paulo Date: Sat, 5 Sep 2026 17:24:34 +0000 Subject: [PATCH] feat(landing): migrate / to astro composed from RouteCard+GridGroup --- src/pages/index.astro | 158 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 src/pages/index.astro diff --git a/src/pages/index.astro b/src/pages/index.astro new file mode 100644 index 0000000..89b07d9 --- /dev/null +++ b/src/pages/index.astro @@ -0,0 +1,158 @@ +--- +// / — the landing route map. The smallest page migration in the refactor: +// six cards rendered through `RouteCard` inside a `GridGroup`, copy lifted +// from the `chapters` collection (`src/content/chapters/landing.json`, +// id `landing`). +// +// Migrated from `index.html` per plans/astro-refactor/task-12-page-landing.md. +// The page is the project's static entry point — it ships zero JavaScript. +// Wrapped in `ChapterLayout` so the chapters.css palette (the drifted +// chapter surface this page has always rendered with) loads before the +// components resolve any colour, and so the surrounding chrome (TopBar, +// SiteFooter, shared CSS) stays in lock-step with the chapter pages that +// already migrated. + +import { getEntry } from 'astro:content'; +import ChapterLayout from '../layouts/ChapterLayout.astro'; +import ChapterHero from '../components/blocks/ChapterHero.astro'; +import GridGroup from '../components/blocks/GridGroup.astro'; +import RouteCard from '../components/blocks/RouteCard.astro'; + +const landing = await getEntry('chapters', 'landing'); +if (!landing) throw new Error('landing page entry missing from chapters collection'); +const base = import.meta.env.BASE_URL; + +// Landing-page copy is English-only today: the existing index.html always +// rendered English, and wiring the full bilingual toggle is a separate task +// (the language-toggle island in `.agents/rules/astro.md`). When that ship +// lands, the `lang` value flows through the same pattern as the other +// chapter pages and every `.en` access below becomes a `[lang]` lookup. +const lang = 'en'; +const data = landing.data; +const cards = data.cards ?? []; +--- + + + AI FOR DUMMIES + 00 / START HERE + review desk ↗ + + + +

{data.lede[lang]}

+ Take the full field guide +
+ + + { + cards.map((card) => ( + + )) + } + + +
+ {data.threadLabel?.[lang]} + {data.threadText?.[lang]} +
+ + {data.footer?.[lang]} +
+ +