Configuration
All site configuration lives in astro.config.mjs.
Version and base path
Section titled “Version and base path”const VERSION = process.env.VERSION || 'main';const base = VERSION === 'main' ? '/' : `/${VERSION}/`;
export default defineConfig({ site: 'https://read.wiki', base, output: 'server', adapter: node({ mode: 'standalone' }), // ...});Build commands:
# Main versionpnpm build# Older versionVERSION=v2.0 pnpm buildDrop each output under a sibling path on the same origin (/, /v2.0/, /v1.0/).
Bilingual locales
Section titled “Bilingual locales”starlight({ defaultLocale: 'zh', locales: { zh: { label: '简体中文', lang: 'zh-CN' }, en: { label: 'English' }, },});Sources live under src/content/docs/{zh,en}/.... Keep the two trees structurally parallel — the language switcher swaps locale segments by string match.
Custom components
Section titled “Custom components”components: { Banner: './src/components/Banner.astro', Header: './src/components/Header.astro', Search: './src/components/Search.astro', Head: './src/components/Head.astro',},customCss: ['./src/styles/custom.css'],Head.astrodelegates to Starlight’s default Head, then appends JSON-LD, AI-discovery<link>s, androbots.Header.astroadds the version dropdown and the search-shortcut hint.custom.cssoverrides--sl-color-accent-*to the site’s ink-teal palette.
Environment variables
Section titled “Environment variables”| Variable | Purpose | Default |
|---|---|---|
VERSION | Build version → base path | main |
BUILD_TIME | Generated timestamp in /llms-full.txt | module load time |
SOURCE_DATE_EPOCH | Same, but Unix seconds — useful for reproducible builds | — |