Skip to content

Astro Configuration

Content repositories do not maintain their own astro.config.mjs. Instead, they import a configuration factory from the @f5xc-salesdemos/docs-theme npm package that returns a complete Astro config with Starlight, eight bundled plugins, and all theme defaults.

A content repo’s astro.config.mjs (provided by the Docker builder) is a thin wrapper:

import { createF5xcDocsConfig } from '@f5xc-salesdemos/docs-theme/config';
export default createF5xcDocsConfig();

All customization is done through the options object or environment variables — there is no need to touch plugin wiring, CSS imports, or component overrides.

createF5xcDocsConfig accepts an F5xcDocsConfigOptions object. Every field is optional; environment variables and sensible defaults fill in the gaps.

interface F5xcDocsConfigOptions {
site?: string;
base?: string;
title?: string;
description?: string;
githubRepository?: string;
llmsOptionalLinks?: Array<{ title: string; url: string }>;
additionalIntegrations?: AstroIntegration[];
additionalRemarkPlugins?: Array<unknown>;
megaMenuItems?: MegaMenuItem[];
head?: HeadEntry[];
logo?: { src: string } | { light: string; dark: string };
}
OptionDefault / Env FallbackPurpose
siteDOCS_SITE or https://f5xc-salesdemos.github.ioCanonical base URL
baseDOCS_BASE or /URL base path for project sites
titleDOCS_TITLE or DocumentationSite title in header and browser tab
descriptionDOCS_DESCRIPTION or empty stringSite description for metadata and llms.txt
githubRepositoryGITHUB_REPOSITORY or empty stringEnables edit links and GitHub social icon
llmsOptionalLinksLLMS_OPTIONAL_LINKS (JSON) or []Additional links for the llms.txt plugin
additionalIntegrations[]Extra Astro integrations to append
additionalRemarkPlugins[]Extra remark plugins added after remark-mermaid
megaMenuItemsBuilt-in Products/Solutions/Docs/Support menuTop-level mega menu entries
headMermaid CDN <script> tagCustom <head> entries
logo@f5xc-salesdemos/docs-theme/assets/github-avatar.pngSidebar logo (single src or light/dark pair)

The factory wires up eight Starlight plugins automatically:

PluginPurpose
starlight-mega-menuTop navigation mega menu with grid/list layouts
starlight-videosEmbed videos in documentation pages
starlight-image-zoomClick-to-zoom on images
@f5xc-salesdemos/docs-theme (self)CSS injection, component overrides, route middleware
starlight-scroll-to-topScroll-to-top button with progress ring
starlight-heading-badgesBadge annotations on headings
starlight-page-actionsPage action buttons
starlight-plugin-iconsIcon support in Starlight
starlight-llms-txtGenerates llms.txt and llms-full.txt for LLM consumption

These are registered in order inside config.ts. The theme plugin (@f5xc-salesdemos/docs-theme) is itself a Starlight plugin that runs in this list.

The theme plugin is defined in index.ts and registered among the bundled plugins above. Its config:setup hook does three things:

  1. Injects CSS — prepends fonts/font-face.css and styles/custom.css to Starlight’s customCss array
  2. Overrides components — replaces five Starlight components:
    • Banner — breadcrumb navigation with edit link
    • EditLink — intentionally empty (edit link lives in Banner)
    • Footer — social media links appended below default footer
    • SiteTitle — logo with home link
    • MarkdownContent — wrapper enabling videos and image zoom
  3. Adds route middleware — registers route-middleware.ts which filters index pages from the sidebar and suppresses the table of contents on index pages
// index.ts — Starlight plugin entry point
export default function f5xcDocsTheme(): StarlightPlugin {
return {
name: '@f5xc-salesdemos/docs-theme',
hooks: {
'config:setup'({ config, updateConfig, addRouteMiddleware }) {
addRouteMiddleware({
entrypoint: '@f5xc-salesdemos/docs-theme/route-middleware',
order: 'pre',
});
updateConfig({
customCss: [
...(config.customCss ?? []),
'@f5xc-salesdemos/docs-theme/fonts/font-face.css',
'@f5xc-salesdemos/docs-theme/styles/custom.css',
],
components: {
...config.components,
Banner: '@f5xc-salesdemos/docs-theme/components/Banner.astro',
EditLink: '@f5xc-salesdemos/docs-theme/components/EditLink.astro',
Footer: '@f5xc-salesdemos/docs-theme/components/Footer.astro',
SiteTitle: '@f5xc-salesdemos/docs-theme/components/SiteTitle.astro',
MarkdownContent: '@f5xc-salesdemos/docs-theme/components/MarkdownContent.astro',
},
});
},
},
};
}

All paths use npm package specifiers (e.g., @f5xc-salesdemos/docs-theme/styles/custom.css) which resolve through the exports map in package.json.

Beyond Starlight and its plugins, the factory also registers:

  • @astrojs/react — enables React component support in MDX pages
  • remark-mermaid — custom remark plugin that converts ```mermaid code blocks into rendered diagrams

Additional integrations and remark plugins can be appended via the additionalIntegrations and additionalRemarkPlugins options.

No custom sidebar is defined. Starlight auto-generates the sidebar from the file structure in docs/, using each page’s title frontmatter as the link text and sidebar.order for sorting. The route middleware filters index pages out of the sidebar automatically.