Reference
Docs stack
The Fumadocs app under docs/ — files, commands, and how content becomes routes.
Stack
| Layer | Choice |
|---|---|
| Framework | Next.js 16.4.6 (App Router) |
| Docs | Fumadocs: fumadocs-core 16.19.10, fumadocs-ui (@fumadocs/base-ui), fumadocs-mdx 15.6.5 |
| Styling | Tailwind CSS v4, shadcn/ui (components.json) and Magic UI components |
| Language | TypeScript (strict), React 19 |
| Package manager | pnpm (10.32.1, pinned by mise.toml) |
Commands
pnpm --dir docs install # dependencies from the lockfile
pnpm --dir docs dev # dev server on :3000
pnpm --dir docs types:check # next typegen && tsc --noEmit
pnpm --dir docs build # production build (also type-checks)
pnpm --dir docs start # serve the production build
mise run docs:build # same build via miseFile map
| Path | Role |
|---|---|
docs/content/docs/{en,zh}/ | MDX content, mirrored per locale |
docs/lib/source.ts | defineDocs + loader() wiring (content → source) |
docs/lib/i18n.ts | Locale list, parser: 'dir', hideLocale: 'never' |
docs/lib/layout.shared.tsx | baseOptions(locale) and the global UI translation strings |
docs/lib/shared.ts | App name, git config, install command, OG image URL helper |
docs/app/(entry)/ | The language chooser at / |
docs/app/[lang]/layout.tsx | Root layout: html lang, RootProvider with the i18n provider |
docs/app/[lang]/(home)/ | The landing page |
docs/app/[lang]/docs/ | The docs layout (sidebar + tabs) and the [[...slug]] catch-all page |
docs/app/api/search/route.ts | Search API (createFromSource), pre-rendered to a static index |
docs/app/og/docs/[lang]/[...slug]/ | OG image generation per locale |
docs/app/llms.txt, llms-full.txt, llms.mdx/ | Agent-facing Markdown endpoints |
docs/next.config.mjs | MDX integration + output: 'export' (static build into out/) |
docs/scripts/postbuild-export.mjs | Publishes the /<lang>/docs/**.md URLs as static files after the build |
How content becomes routes
fumadocs-mdxcompilescontent/docs/**(frontmatter viapageSchema, navigation viametaSchema).loader()inlib/source.tsapplies the i18n config: files undercontent/docs/<locale>/…are grouped per locale, slugs exclude the locale folder, and page URLs become/<locale>/docs/<slugs>.- Root folders (
user,contributor, both"root": true) build two page trees — one per section — rendered as the docs layout's top-level tabs. app/[lang]/docs/[[...slug]]/page.tsxlooks pages up withsource.getPage(params.slug, params.lang)and renders the MDX body, withcreateRelativeLink(source, page)resolving relative.mdxlinks inside the current locale.- Static generation comes from
source.generateParams()(slug × locale) plusgenerateStaticParamsin the landing and chooser pages.
Agent-facing surfaces
GET /llms.txt,/llms-full.txt— index and full text, both locales.GET /<lang>/docs/<path>.md— the Markdown of one page, published as a static file byscripts/postbuild-export.mjs. (The formerAccept: markdownnegotiation for extensionless URLs was dropped with the static export — clients should append.mdto the page URL.)
Related
- Add or edit content: How to extend the docs
- The i18n details: i18n layout