From a46714ce34ddb2c99f85749c1f9bd7c9d7b4278e Mon Sep 17 00:00:00 2001 From: Iain Date: Thu, 8 Oct 2026 17:12:01 +0100 Subject: [PATCH] feat: add a sitemap page, linked from the footer --- src/components/layout/Footer.astro | 1 + src/components/ui/PageTree.astro | 75 ++++++++++++++++++++++++++++++ src/pages/sitemap.astro | 36 ++++++++++++++ 3 files changed, 112 insertions(+) create mode 100644 src/components/ui/PageTree.astro create mode 100644 src/pages/sitemap.astro diff --git a/src/components/layout/Footer.astro b/src/components/layout/Footer.astro index 506c132..b07d5b4 100644 --- a/src/components/layout/Footer.astro +++ b/src/components/layout/Footer.astro @@ -9,6 +9,7 @@ const links = [ { label: 'Contribute', url: '/contribute/' }, { label: 'About', url: '/about/' }, { label: 'API', url: '/about/#api' }, + { label: 'Sitemap', url: '/sitemap/' }, ]; --- diff --git a/src/components/ui/PageTree.astro b/src/components/ui/PageTree.astro new file mode 100644 index 0000000..c195675 --- /dev/null +++ b/src/components/ui/PageTree.astro @@ -0,0 +1,75 @@ +--- +const { pages, depth = 1 } = Astro.props; +--- + + + + diff --git a/src/pages/sitemap.astro b/src/pages/sitemap.astro new file mode 100644 index 0000000..c505b6b --- /dev/null +++ b/src/pages/sitemap.astro @@ -0,0 +1,36 @@ +--- +import Base from '../components/layout/Base.astro'; +import PageHead from '../components/layout/PageHead.astro'; +import PageTree from '../components/ui/PageTree.astro'; +import { getModel } from '../lib/data/model.js'; + +const { brands, devices, roms } = getModel(); +const pages = [ + { label: 'Home', url: '/' }, + { + label: 'Devices', + url: '/devices/', + children: brands.map((brand) => ({ + label: brand.name, + url: brand.url, + children: brand.devices.map((device) => ({ + label: device.name, + url: device.url, + code: device.codenames[0], + })), + })), + }, + { label: 'ROMs', url: '/roms/', children: roms.map(({ name, url }) => ({ label: name, url })) }, + { label: 'Contribute', url: '/contribute/' }, + { label: 'About', url: '/about/' }, +]; +--- + + + + +