// @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, // Not a file in `public/`: the brand route derives this from whichever `logo.png` is // mounted (§7), so the docs' tab icon changes with a rebrand like everything else. // Starlight's default is `/favicon.svg`, which does not exist here — every docs page // was requesting a 404 for it. favicon: '/brand/favicon.ico', // 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 takes an asset imported through Vite, which // fingerprints the filename into the build — and a fingerprinted logo is one the // bind mount can never replace (§7). The override points at the stable // `/brand/*` URL instead. SiteTitle: './src/components/DocsSiteTitle.astro', // Starlight builds its own head, so the docs otherwise miss the brand stylesheet, // the manifest and the OG card entirely. See the component. Head: './src/components/DocsHead.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', }, });