feat(site): phase 1 — the foundation
Some checks failed
PR checks / checks (pull_request) Failing after 4m19s
Some checks failed
PR checks / checks (pull_request) Failing after 4m19s
Astro 7 with the Node adapter, Starlight mounted at /docs, the token file, both self-hosted typefaces, the layout shell, and the two build-time checks from §12. The palette's gold and cyan are sampled from runic-emblem.png rather than guessed, per §11: 494,059 opaque pixels binned by hue, each value annotated with its measured contrast against the ground, and restricted rather than brightened where a ratio fails. - checkTokens.mjs fails the build on any colour literal outside tokens.css, which is what keeps §7's "recolouring is a file copy" promise true. - checkFacts.mjs re-reads all 14 externally-sourced facts from their authorities over the Gitea API and fails on disagreement. It also enforces D13: no email address in the source outside brand-default/brand.json. - Both were negative-tested; neither has ever been allowed to pass by default. §6 asks for output:'server' with per-page prerender=true. Astro 7 expresses the same runtime shape as output:'static' with an adapter, opting individual routes out — so the default is static rather than accidentally server-rendered. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
59
astro.config.mjs
Normal file
59
astro.config.mjs
Normal file
@@ -0,0 +1,59 @@
|
||||
// @ts-check
|
||||
import { defineConfig } from 'astro/config';
|
||||
import node from '@astrojs/node';
|
||||
import starlight from '@astrojs/starlight';
|
||||
|
||||
import { docsSidebar } from './src/config/sidebar.mjs';
|
||||
|
||||
/**
|
||||
* PLAN.md §6 calls this "Astro with the Node adapter, `output: 'server'` with per-page
|
||||
* `prerender = true`". Astro 7 expresses that shape the other way round: `output: 'static'`
|
||||
* with an adapter prerenders everything and lets individual routes opt OUT with
|
||||
* `export const prerender = false`. The runtime result is identical to what §6 describes —
|
||||
* a container serving prerendered HTML, with a handful of routes executing per request —
|
||||
* and this is the direction the framework supports, so the default is the safe one: a page
|
||||
* added without thinking about it is static, not accidentally server-rendered.
|
||||
*
|
||||
* The two routes that will opt out live in phases 2 and 5: `GET /brand/*` (§7) and
|
||||
* `POST /api/beta-signup` (§8).
|
||||
*/
|
||||
export default defineConfig({
|
||||
site: 'https://runicgateway.com',
|
||||
output: 'static',
|
||||
adapter: node({ mode: 'standalone' }),
|
||||
|
||||
build: {
|
||||
// Directory-style URLs, so every link in prose can end in a slash and mean it.
|
||||
format: 'directory',
|
||||
},
|
||||
|
||||
integrations: [
|
||||
starlight({
|
||||
title: 'Runic Gateway',
|
||||
// Marketing owns the 404 (§10); a Starlight-chrome 404 on `/features/` would be wrong.
|
||||
disable404Route: true,
|
||||
// Starlight's own light/dark switch is deliberate: §11 keeps marketing single-theme
|
||||
// but has the docs honour the reader's preference.
|
||||
customCss: ['./src/styles/tokens.css', './src/styles/starlight.css'],
|
||||
components: {
|
||||
// Not the `logo` option: that renders an <img>, and our mark is drawn in
|
||||
// currentColor so it inherits --gold and follows a mounted theme.css. An SVG
|
||||
// loaded through <img> is a separate document with nothing to inherit from, so it
|
||||
// renders black on black. The override inlines it instead — see the component.
|
||||
SiteTitle: './src/components/DocsSiteTitle.astro',
|
||||
},
|
||||
credits: false,
|
||||
sidebar: docsSidebar,
|
||||
pagination: true,
|
||||
lastUpdated: false,
|
||||
editLink: {
|
||||
baseUrl: 'https://gitea.whitlocktech.com/RunicGateway/runicgateway.com/_edit/main/',
|
||||
},
|
||||
}),
|
||||
],
|
||||
|
||||
prefetch: {
|
||||
prefetchAll: true,
|
||||
defaultStrategy: 'hover',
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user