# docs **Repository Path**: browserwing/docs ## Basic Information - **Project Name**: docs - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-01-27 - **Last Updated**: 2026-01-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # browserwing 这是一个使用 [Create Fumadocs](https://github.com/fuma-nama/fumadocs) 生成的 Next.js 应用程序,支持国际化(i18n)。 ## 运行开发服务器 ```bash npm run dev # 或 pnpm dev # 或 yarn dev ``` 在浏览器中打开 http://localhost:3000 查看结果。 ## 国际化 (i18n) 本项目支持多语言文档: - 默认语言:中文 (zh) - 支持的语言:中文 (zh)、英文 (en) ### 访问不同语言的文档 - 中文文档:http://localhost:3000/zh/docs - 英文文档:http://localhost:3000/en/docs ### 文档文件结构 项目使用 Fumadocs 的 `dir` 模式进行国际化,文档按语言文件夹组织: ``` content/docs/ ├── zh/ # 中文文档 │ ├── meta.json │ ├── index.mdx │ └── test.mdx └── en/ # 英文文档 ├── meta.json ├── index.mdx └── test.mdx ``` ### 添加新语言 1. 在 `src/lib/i18n.ts` 中添加新语言代码和语言标签 2. 在 `content/docs/` 下创建新的语言文件夹(例如:`fr/` 用于法语) 3. 在新文件夹中创建 `meta.json` 和对应的 `.mdx` 文档文件 ## 项目结构 在项目中,你可以看到: - `lib/source.ts`: 内容源适配器代码,[`loader()`](https://fumadocs.dev/docs/headless/source-api) 提供访问内容的接口 - `lib/layout.shared.tsx`: 布局的共享选项,包含语言切换器 - `lib/i18n.ts`: 国际化配置 | 路由 | 描述 | | --------------------------- | ------------------------------ | | `app/(home)` | 首页和其他页面的路由组 | | `app/[lang]/docs` | 支持多语言的文档布局和页面 | | `app/api/search/route.ts` | 搜索的路由处理器 | | `middleware.ts` | 处理语言重定向的中间件 | ### Fumadocs MDX 项目中包含了 `source.config.ts` 配置文件,你可以自定义不同的选项,如 frontmatter schema。 阅读 [介绍文档](https://fumadocs.dev/docs/mdx) 了解更多详情。 ## 了解更多 要了解更多关于 Next.js 和 Fumadocs 的信息,请查看以下资源: - [Next.js 文档](https://nextjs.org/docs) - 了解 Next.js 的特性和 API - [学习 Next.js](https://nextjs.org/learn) - 交互式 Next.js 教程 - [Fumadocs](https://fumadocs.dev) - 了解 Fumadocs