Files
2026-03-04 13:14:40 +08:00

80 lines
1.4 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 配置说明
## 主题配置
在 `theme.config.tsx` 中配置主题:
```typescript
export default {
logo: <span>你的站点名称</span>,
project: {
link: "https://github.com/your-username/your-repo",
},
docsRepositoryBase: "https://github.com/your-username/your-repo",
footer: {
text: "你的站点名称",
},
sidebar: {
defaultMenuCollapseLevel: 1,
autoCollapse: true,
},
}
```
### 关键配置项
| 配置项 | 说明 |
|--------|------|
| `logo` | 站点 Logo |
| `project.link` | 项目仓库链接 |
| `docsRepositoryBase` | 文档仓库基础 URL |
| `footer.text` | 页脚文本 |
| `defaultMenuCollapseLevel` | 默认菜单折叠级别 |
| `autoCollapse` | 是否自动折叠 |
## 导航配置
### 主导航
编辑 `app/_meta.js`
```javascript
export default {
index: "首页",
"getting-started": "入门指南",
guide: "使用指南"
}
```
### 子导航
编辑子目录的 `_meta.js`,例如 `app/getting-started/_meta.js`
```javascript
export default {
installation: "安装指南",
quickstart: "快速开始",
configuration: "配置说明"
}
```
## Next.js 配置
在 `next.config.mjs` 中配置:
```javascript
import nextra from 'nextra'
const withNextra = nextra({
theme: 'nextra-theme-docs',
themeConfig: './theme.config.tsx',
})
export default withNextra({
output: 'export', // 静态导出
})
```
## 自定义样式
你可以在 `app/globals.css` 中添加自定义样式。