Docs System
Quick Configuration
Configure docs visibility, docs alias, sidebar structure, and page tree source.
The docs module renders MDX from content/docs and builds sidebar navigation, powered by Fumadocs and Content Collections. This guide covers scope, entry points, and common config.
Fast Edit Path
Toggle docs module
// src/config/index.ts
ui: {
docs: {
enabled: true, // Set false to redirect /docs/** to home
},
}Docs alias and menu copy
// src/config/index.ts
i18n: {
locales: {
en: {
docsAlias: "Docs",
headerMenuMap: { docs: "MVP Docs" },
},
zh: {
docsAlias: "文档",
headerMenuMap: { docs: "MVP 文档" },
},
},
}Sidebar structure
// content/docs/meta.en.json
{
"title": "MuseMVP Docs",
"icon": "BookOpen",
"pages": ["index", "tech-stack", "development", "quick-build", "cms"]
}pages Order
The pages array defines left sidebar order. Sub-categories (e.g. cms) need a matching content/docs/cms/meta.{locale}.json.
Doc Organization Rules
cms-docs.en.mdx
cms-blog.en.mdx
meta.en.json
index.en.mdx
meta.en.json
| Type | Path | Description |
|---|---|---|
| Doc content | content/docs/**/*.mdx | Supports *.zh.mdx, *.en.mdx for i18n |
| Category meta | content/docs/<category>/meta.{locale}.json | Sub-category pages and title |
| Root meta | content/docs/meta.{locale}.json | Root sidebar order and groups |
| Icons | frontmatter icon | Mapped by docsSource.icon() to icon components |
Config Reference
| Config | Location | Default | Effect |
|---|---|---|---|
config.ui.docs.enabled | src/config/index.ts | true | Controls /docs/** access; when false, redirects to home |
config.i18n.locales.*.docsAlias | src/config/index.ts | "Docs" / "文档" | Docs site title and page title suffix |
content/docs/meta.{locale}.json | content/docs | — | Left sidebar order and groups |
docsSource.icon() | src/lib/docs-source.ts | — | Maps frontmatter icon to icon component |
Adding a New Doc
Create *.zh.mdx and/or *.en.mdx under content/docs or a subdirectory.
Add frontmatter: title, description, icon.
Register the page path in the pages array of the relevant meta.{locale}.json.
Related Docs
- Fumadocs Special Blocks — Callout, Cards, Steps, etc.
- Blog Configuration — Blog toggle and frontmatter