Docs Hub

Adding a project

Publish another project without changing the shared documentation components.

Create the content

Create one MDX file for each page under a project folder:

src/content/my-project/
├── overview.mdx
├── getting-started.mdx
└── api-reference.mdx

Use one level-one heading for the page title. Level-two and level-three headings can be included in the page table of contents.

Register the project

Add a DocProjectDefinition to src/lib/docs/registry.ts. Page slugs must match the content loader keys and remain unique within the project.

{
  slug: "my-project",
  name: "My Project",
  shortName: "MP",
  description: "A short project summary.",
  accent: "#7c3aed",
  accentDark: "#c4b5fd",
  version: "1.0.0",
  status: "Stable",
  pages: [
    {
      slug: "overview",
      label: "Overview",
      description: "What the project does.",
      group: "Start here",
      headings: [],
    },
  ],
}

Use accent for light surfaces and accentDark for dark surfaces. Both values should remain readable as text and as a filled project mark in their respective themes.

Register the loader

Map each project/page key to an explicit dynamic import in src/content/loader.ts:

"my-project/overview": () => import("./my-project/overview.mdx")

Explicit imports keep the modules visible to the bundler and make missing content fail during development instead of at runtime.

Validate the output

Run the complete validation sequence:

npm run typecheck
npm run lint
npm run build

The build should emit an HTML document for every registered page beneath the out/docs directory.