// mcqemu docs — Starlight with a diataxis-shaped sidebar. // // Telemetry and devToolbar are off per project convention. The HMR block // matters when the dev server runs behind Caddy: Vite's WebSocket needs an // explicit host, protocol and clientPort or HMR drops every few seconds // with "server connection lost". // // DOMAIN drives both the canonical site URL and the HMR host, so the same // image serves mcqemu.warehack.ing (prod) and mcqemu.l.warehack.ing (dev). import mdx from "@astrojs/mdx"; import sitemap from "@astrojs/sitemap"; import starlight from "@astrojs/starlight"; import { defineConfig } from "astro/config"; import remarkGfm from "remark-gfm"; import starlightLinksValidator from "starlight-links-validator"; const domain = process.env.DOMAIN ?? "mcqemu.warehack.ing"; export default defineConfig({ site: `https://${domain}`, telemetry: false, devToolbar: { enabled: false }, vite: { server: { host: "0.0.0.0", hmr: { host: domain, protocol: "wss", clientPort: 443, }, }, }, integrations: [ starlight({ title: "mcqemu", description: "MCP server for QEMU: VM lifecycle, disposable sandboxes, live snapshots, guest-agent access, and screenshot-driven control.", favicon: "/favicon.svg", customCss: ["./src/styles/theme.css"], // Keep the default footer and hang the studio badge under it. components: { Footer: "./src/components/Footer.astro", }, social: [ { icon: "seti:git", label: "Source", href: "https://git.supported.systems/warehack.ing/mcqemu", }, ], // Diataxis order: orientation, then learning, then doing, then // looking up, then understanding. // Starlight v0.39+ needs {label, items:[{autogenerate}]}; the inline // {label, autogenerate} shorthand was removed. sidebar: [ { label: "Start here", items: [ { label: "What is mcqemu?", slug: "overview" }, { label: "The talk", slug: "talk" }, ], }, { label: "Tutorial", items: [{ autogenerate: { directory: "tutorial" } }], }, { label: "How-to", items: [{ autogenerate: { directory: "how-to" } }], }, { label: "Reference", items: [{ autogenerate: { directory: "reference" } }], }, { label: "Explanation", items: [{ autogenerate: { directory: "explanation" } }], }, ], plugins: [ // Broken internal links fail the build instead of shipping. starlightLinksValidator({ errorOnRelativeLinks: false }), ], pagination: true, lastUpdated: true, }), // Astro enables GFM for .md, but the MDX pipeline does not inherit it, // so tables render as run-together paragraphs without this. mdx({ remarkPlugins: [remarkGfm] }), sitemap(), ], });