docs-theme
{pkg} provides a Starlight plugin and a reusable content loader for all @theholocron documentation sites.
Install
Section titled “Install”pnpm add @theholocron/docs-themeExports
Section titled “Exports”| Export | Description |
|---|---|
@theholocron/docs-theme |
docsTheme() Starlight plugin |
@theholocron/docs-theme/loader |
createDocsLoader() Astro content loader |
@theholocron/docs-theme/content |
createDocsCollections() for content config |
Starlight plugin
Section titled “Starlight plugin”Wire up the plugin in astro.config.ts via @theholocron/astro-config:
import starlight from "@astrojs/starlight";import { defineConfig } from "@theholocron/astro-config";import { docsTheme } from "@theholocron/docs-theme";
export default defineConfig({ docs: { ... }, starlight, docsTheme });Content collections
Section titled “Content collections”Add createDocsCollections() to docs/src/content.config.ts:
import { createDocsCollections } from "@theholocron/docs-theme/content";export const collections = createDocsCollections();Custom content loader
Section titled “Custom content loader”Use createDocsLoader() when content lives outside the standard Starlight path:
import { createDocsLoader } from "@theholocron/docs-theme/loader";import { defineCollection } from "astro:content";import { docsSchema } from "@astrojs/starlight/schema";
export const collections = { docs: defineCollection({ loader: createDocsLoader([{ dir: "/path/to/content", slug: "" }]), schema: docsSchema(), }),};