This is a Next.js application generated with Create Fumadocs.
Run development server:
pnpm devOpen http://localhost:3000 with your browser to see the result.
Useful scripts:
pnpm lint
pnpm lint:fix
pnpm types:check
pnpm buildIn the project, you can see:
content/docs/{en,zh}: bilingual documentation content (.mdxfiles)app/[lang]/[[...slug]]: localized docs pages mounted on/{lang}lib/source.ts: Fumadocs source loader, reads fromcontent/docssource.config.ts: MDX collection config (schema/custom options)lib/layout.shared.tsx: shared nav/github layout options
| Route | Description |
|---|---|
app/[lang]/[[...slug]] |
The localized documentation layout and pages. |
app/api/search/route.ts |
The Route Handler for search. |
- 文档目录是
content/docs/{en,zh} - 每个
.mdx文件会自动变成一个页面 content/docs/zh/index.mdx对应/zhcontent/docs/en/features/index.mdx对应/en/features
- 在
content/docs/en或content/docs/zh下新建文件,例如features/getting-started.mdx - 写入 frontmatter(至少
title、description) - 写正文(支持 Markdown + MDX 组件)
- 运行
pnpm dev预览
示例:
---
title: Getting Started
description: Quick setup guide
---
# Getting Started
欢迎使用文档站。可在 content/docs/en/meta.json、content/docs/zh/meta.json 以及各子目录的 meta.json 里定义导航顺序、分组和标题覆写。没配置时默认按文件结构生成导航。
pnpm dev # 本地预览
pnpm lint # ESLint 检查
pnpm types:check # 类型检查A source.config.ts config file has been included, you can customise different options like frontmatter schema.
Read the Introduction for further details.
To learn more about Next.js and Fumadocs, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
- Fumadocs - learn about Fumadocs