/** * The footer's link columns. * * Data rather than markup, and in `src/data/` beside `legal.mjs` and `collection.mjs`, for * one reason: the links shipped wrong. All three entries under "Documentation" pointed at * `/docs/`, so the column rendered three different labels that went to the same page — and * every check passed, because each href resolved perfectly well. `checkLinks.mjs` asks * whether a link is broken; nothing asked whether a link goes where its label says. * * `test/footer.test.mjs` asks that now, which it can only do because the columns are * importable. That is the whole reason this file exists. * * The two Project links are brand-supplied (§7, D13), so this is a function of the rendered * brand rather than a constant — the mounted `brand.json` decides them, and `/beta` renders * per request, so they cannot be baked at build time. */ /** Documentation sections a footer link may point into, and where each one starts. */ export const docsEntryPoints = { 'getting-started': '/docs/getting-started/requirements/', administration: '/docs/administration/configuration/', modules: '/docs/modules/building-a-module/', }; export function footerColumns(brand) { return [ { heading: 'Product', links: [ { href: '/features/', label: 'Features' }, { href: '/architecture/', label: 'Architecture' }, { href: '/modules/', label: 'Modules' }, { href: '/app/', label: 'Android app' }, ], }, { // Each of these lands INSIDE the section it names. The docs home — "What is Runic // Gateway?", the first page of Getting started — is the header's `Docs` link, so a // footer entry pointing there as well would be a fourth way to the same page rather // than a way into the section. heading: 'Documentation', links: [ { href: docsEntryPoints['getting-started'], label: 'Getting started' }, { href: docsEntryPoints.administration, label: 'Administration' }, { href: docsEntryPoints.modules, label: 'Building a module' }, ], }, { heading: 'Project', links: [ { href: brand.giteaOrg, label: 'Source' }, { href: brand.discordInvite, label: 'Discord' }, { href: '/community/', label: 'Community' }, ], }, ]; }