Skip to content

Configuration Reference

This page documents every configuration option available in the documentation site.

The main configuration file uses Astro’s defineConfig helper with the Starlight integration:

import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";
export default defineConfig({
site: "https://docs.example.com", // Canonical URL
integrations: [
starlight({
title: "Docs", // Site title
sidebar: [/* ... */], // Navigation structure
// ...additional options
}),
],
});
OptionTypeDefaultDescription
sitestringCanonical URL, used for sitemaps and <link rel="canonical">
basestring"/"Base path if the site is not served from the root
output"static" | "server""static"Output mode; keep static for documentation
trailingSlash"always" | "never" | "ignore""ignore"Whether URLs end with a slash
OptionTypeDescription
titlestringSite title shown in header and browser tab
logoobjectLogo image with light and dark variants
sidebarSidebarItem[]Navigation structure (see Customization)
socialobjectSocial media links shown in the header
defaultLocalestringDefault language code (e.g., "en")
localesobjecti18n locale definitions
customCssstring[]Paths to custom CSS files for theming
headHeadConfig[]Custom elements injected into <head>
editLinkobject”Edit this page” link configuration
tableOfContentsobject | falseOn-page table of contents settings
lastUpdatedbooleanShow “Last updated” date on pages
paginationbooleanShow previous/next page links

Environment variables are loaded from a .env file (or your hosting provider’s settings). Variables prefixed with PUBLIC_ are available in the browser.

VariablePrefixRequiredDescription
SITE_URLNoCanonical URL; used at build time for sitemaps
PUBLIC_SUPABASE_URLPUBLIC_NoSupabase project URL (e.g., https://abc.supabase.co)
PUBLIC_SUPABASE_ANON_KEYPUBLIC_NoSupabase anonymous API key for client-side requests
PUBLIC_GA_MEASUREMENT_IDPUBLIC_NoGoogle Analytics 4 measurement ID

To enable interactive features (feedback widget and search):

  1. Create a Supabase project
  2. Run the migration: npx supabase db push (or apply supabase/migrations/20240101000000_initial_schema.sql manually)
  3. Optionally load seed data: npx supabase db seed
  4. Copy the project URL and anon key from Settings > API into your .env

Without Supabase credentials, the site works normally — feedback and search components are hidden or fall back to static behavior.

TypeScript is configured through tsconfig.json (generated by Astro) and used by:

  • npm run check — Astro type checking for .astro files
  • npm run typecheck — Standard tsc --noEmit for .ts files

Strict mode is enabled by default. Path aliases use @/ to reference src/.

The docs collection is defined in src/content.config.ts using the Starlight schema:

export const collections = {
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
};

The schema validates frontmatter automatically. Required fields: title. Optional fields include description, sidebar, tableOfContents, draft, hero, and banner.

CommandOutputDescription
npm run builddist/Production-ready static files
npm run devDevelopment server on port 4321
npm run previewPreview of the production build