// @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 , and our mark is drawn in // currentColor so it inherits --gold and follows a mounted theme.css. An SVG // loaded through 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', }, });