first commit

This commit is contained in:
2026-03-04 13:14:40 +08:00
commit 96e65a9b43
26 changed files with 5068 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
export default {
installation: "1. 安装指南",
quickstart: "2. 快速开始",
configuration: "3. 配置说明",
};

View File

@@ -0,0 +1,80 @@
# 配置说明
## 主题配置
在 `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` 中添加自定义样式。

View File

@@ -0,0 +1,47 @@
# 安装指南
## 环境要求
- Node.js 18.x 或更高版本
- pnpm 8.x 或更高版本
## 安装步骤
### 1. 克隆模板
```bash
git clone <your-repo-url>
cd nextra-docs-template
```
### 2. 安装依赖
```bash
pnpm install
```
### 3. 验证安装
```bash
pnpm dev
```
如果安装成功,浏览器会自动打开 `http://localhost:3000`。
## 常见问题
### Node.js 版本过低
请升级到 Node.js 18.x 或更高版本:
```bash
# 使用 nvm 安装
nvm install 18
nvm use 18
```
### pnpm 未安装
```bash
npm install -g pnpm
```

View File

@@ -0,0 +1,53 @@
# 快速开始
本指南将帮助你在 5 分钟内创建你的第一个文档页面。
## 创建文档页面
### 1. 添加新页面
在 `app` 目录下创建新的 `.mdx` 文件:
```
app/
└── getting-started/
└── my-first-page.mdx # 新建文件
```
### 2. 编写内容
在 `my-first-page.mdx` 中添加内容:
```markdown
# 我的第一个页面
这是我的第一个文档页面!
## 功能特性
- 功能一
- 功能二
- 功能三
```
### 3. 更新导航
编辑 `app/getting-started/_meta.js`
```javascript
export default {
installation: "安装指南",
quickstart: "快速开始",
configuration: "配置说明",
"my-first-page": "我的页面"
}
```
### 4. 查看结果
刷新浏览器,你会在侧边栏看到新页面。
## 下一步
- [配置说明](/getting-started/configuration) - 了解如何自定义配置
- [基础概念](/guide/basics) - 学习更多使用技巧