Skip to content

docs-theme

{pkg} provides a Starlight plugin and a reusable content loader for all @theholocron documentation sites.

Terminal window
pnpm add @theholocron/docs-theme
Export Description
@theholocron/docs-theme docsTheme() Starlight plugin
@theholocron/docs-theme/loader createDocsLoader() Astro content loader
@theholocron/docs-theme/content createDocsCollections() for content config

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 });

Add createDocsCollections() to docs/src/content.config.ts:

import { createDocsCollections } from "@theholocron/docs-theme/content";
export const collections = createDocsCollections();

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(),
}),
};