import './plugins/environment.mjs'; import { defineConfig } from 'astro/config'; import { unified } from '@astrojs/markdown-remark'; import documentLinks, { normalizeBase } from './plugins/document-links.mjs'; const base = normalizeBase(process.env.SITE_BASE || '/'); const site = process.env.SITE_URL || undefined; if (site) { const url = new URL(site); if (!['http:', 'https:'].includes(url.protocol) || url.username || url.password || url.search || url.hash || url.pathname !== '/') { throw new Error('SITE_URL must be an http(s) origin; use SITE_BASE for a path prefix'); } } export default defineConfig({ output: 'static', site, base, trailingSlash: 'always', // Browser tests exercise the site, not the development toolbar overlay. devToolbar: { enabled: process.env.SITE_BROWSER_TEST !== '1' }, markdown: { processor: unified({ remarkPlugins: [[documentLinks, { base }]], smartypants: false }), shikiConfig: { themes: { light: 'github-light', dark: 'github-dark' }, langAlias: { wip: 'text' } }, }, });