Analytics
Google Analytics 4 with Consent Mode v2 and IP anonymization.
This page showcases all the components and plugins available in this documentation template. Use them to create rich, interactive documentation pages.
Use tabs to organize content by context, such as different package managers or languages.
npm install astro-starlight-docs-templateyarn add astro-starlight-docs-templatepnpm add astro-starlight-docs-templatebun add astro-starlight-docs-templateAnalytics
Google Analytics 4 with Consent Mode v2 and IP anonymization.
GDPR
Automatic GDPR compliance with regional cookie consent.
SEO
Open Graph, Twitter Cards, and Schema.org structured data.
LLM Support
AI-friendly metadata and llms.txt generation.
One Command
Run npx astro-starlight-docs-template init and you’re done.
Zero Config
Sensible defaults for everything. Customize only what you need.
Use the Steps component for sequential instructions.
Install the package
npx astro-starlight-docs-template initAnswer the prompts
Provide your Google Analytics ID, site URL, and preferences.
Build your site
npm run buildDeploy
Push to GitHub Pages, Vercel, Netlify, or any static host.
Visualize your project structure.
Inline badges for status indicators:
This template includes Mermaid diagram support. Use fenced code blocks with the mermaid language.
import { defineConfig } from 'astro/config';import starlight from '@astrojs/starlight';import starlightOpenAPI from 'starlight-openapi';
export default defineConfig({ integrations: [ starlight({ plugins: [ starlightOpenAPI([{ base: 'api', schema: './schemas/openapi.yaml', }]), ], }), ],});// Beforeconst config = {- analytics: false,- gdpr: false,+ analytics: true,+ gdpr: true,+ seo: {+ ogImage: '/og-image.svg',+ twitterCard: 'summary_large_image',+ },};$ npx astro-starlight-docs-template init
🚀 Astro Starlight Docs Template v1.0.1
🔍 Checking if this is an Astro Starlight project...
✓ Astro project detected✓ Starlight integration found
? Google Analytics Measurement ID: G-XXXXXXXXXX? Site URL: https://example.com? Create custom footer? Yes
✅ All done! Run `npm run build` to see your changes.This template includes the starlight-openapi plugin which auto-generates API documentation from OpenAPI/Swagger specifications. Check the API Reference section in the sidebar to see it in action.
The API docs are generated from schemas/openapi.yaml and include:
Images in this documentation support click-to-zoom for better readability. Try clicking on the hero image on the home page.
This template includes a blog section powered by starlight-blog. The blog lives alongside your documentation and supports posts, tags, authors, and RSS feeds.
All these components are available out of the box in this template:
| Component | Source | Type |
|---|---|---|
| Tabs | Built-in | Interactive |
| Cards / CardGrid | Built-in | Layout |
| LinkCard | Built-in | Navigation |
| Steps | Built-in | Sequential |
| FileTree | Built-in | Visualization |
| Badge | Built-in | Inline |
| Asides | Built-in | Callout |
| Mermaid Diagrams | Plugin | Visualization |
| OpenAPI Docs | Plugin | API Reference |
| Image Zoom | Plugin | Enhancement |
| Blog | Plugin | Content |
| Link Validation | Plugin | Build-time check |