create-react-docs-ui 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +14 -2
- package/template/package.json +2 -2
- package/template/public/docs/en/guide/configuration.md +122 -69
- package/template/public/docs/en/guide/installation.md +63 -139
- package/template/public/docs/en/guide/introduction.md +28 -50
- package/template/public/docs/en/guide/quick-start.md +109 -217
- package/template/public/docs/en/guide.md +10 -31
- package/template/public/docs/en/index.md +34 -58
- package/template/public/docs/zh-cn/guide/configuration.md +14 -61
- package/template/public/docs/zh-cn/guide/installation.md +23 -26
- package/template/public/docs/zh-cn/guide/introduction.md +11 -12
- package/template/public/docs/zh-cn/guide/quick-start.md +30 -21
- package/template/public/docs/zh-cn/guide.md +5 -5
- package/template/public/docs/zh-cn/index.md +9 -9
- package/template/src/main.tsx +2 -2
|
@@ -1,217 +1,109 @@
|
|
|
1
|
-
# Quick Start
|
|
2
|
-
|
|
3
|
-
This guide will
|
|
4
|
-
|
|
5
|
-
## Project
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
###
|
|
50
|
-
|
|
51
|
-
Update
|
|
52
|
-
|
|
53
|
-
```yaml
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
Vue Docs UI supports enhanced Markdown with:
|
|
111
|
-
|
|
112
|
-
### Code Highlighting
|
|
113
|
-
```javascript
|
|
114
|
-
// JavaScript code is highlighted
|
|
115
|
-
function greet(name) {
|
|
116
|
-
return `Hello, ${name}!`
|
|
117
|
-
}
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
### Tables
|
|
121
|
-
| Feature | Status | Description |
|
|
122
|
-
|---------|--------|-------------|
|
|
123
|
-
| Responsive | ✅ | Works on all devices |
|
|
124
|
-
| Themes | ✅ | Light and dark mode |
|
|
125
|
-
| Search | ✅ | Built-in search |
|
|
126
|
-
|
|
127
|
-
### Math (Optional)
|
|
128
|
-
If you need math equations, you can add support for LaTeX:
|
|
129
|
-
|
|
130
|
-
Inline math: $E = mc^2$
|
|
131
|
-
|
|
132
|
-
Block math:
|
|
133
|
-
$$
|
|
134
|
-
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
|
|
135
|
-
$$
|
|
136
|
-
|
|
137
|
-
## Customizing Appearance
|
|
138
|
-
|
|
139
|
-
### Theme Colors
|
|
140
|
-
Customize your site's colors in `site.yaml`:
|
|
141
|
-
|
|
142
|
-
```yaml
|
|
143
|
-
theme:
|
|
144
|
-
colors:
|
|
145
|
-
primary: "#3b82f6" # Main brand color
|
|
146
|
-
secondary: "#64748b" # Secondary text
|
|
147
|
-
accent: "#06b6d4" # Accent color
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
### Fonts
|
|
151
|
-
```yaml
|
|
152
|
-
theme:
|
|
153
|
-
fonts:
|
|
154
|
-
primary: "Inter, -apple-system, BlinkMacSystemFont, sans-serif"
|
|
155
|
-
mono: "JetBrains Mono, Consolas, monospace"
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
## Adding Images
|
|
159
|
-
|
|
160
|
-
Place images in `public/images/` and reference them in your Markdown:
|
|
161
|
-
|
|
162
|
-
```markdown
|
|
163
|
-

|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
Or with custom sizing:
|
|
167
|
-
```markdown
|
|
168
|
-
<img src="/images/screenshot.png" alt="Screenshot" width="600">
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
## Best Practices
|
|
172
|
-
|
|
173
|
-
### 1. Organize Your Content
|
|
174
|
-
```
|
|
175
|
-
public/docs/
|
|
176
|
-
├── guide/
|
|
177
|
-
│ ├── introduction.md
|
|
178
|
-
│ ├── installation.md
|
|
179
|
-
│ └── quick-start.md
|
|
180
|
-
├── api/
|
|
181
|
-
│ ├── components.md
|
|
182
|
-
│ └── utilities.md
|
|
183
|
-
└── examples/
|
|
184
|
-
├── basic.md
|
|
185
|
-
└── advanced.md
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
### 2. Use Descriptive Titles
|
|
189
|
-
- Good: "Setting up Authentication"
|
|
190
|
-
- Bad: "Auth Setup"
|
|
191
|
-
|
|
192
|
-
### 3. Add Table of Contents
|
|
193
|
-
Enable TOC in your `site.yaml`:
|
|
194
|
-
|
|
195
|
-
```yaml
|
|
196
|
-
toc:
|
|
197
|
-
enabled: true
|
|
198
|
-
maxLevel: 3
|
|
199
|
-
title: "On This Page"
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
### 4. Link Between Pages
|
|
203
|
-
Use relative links to connect your content:
|
|
204
|
-
|
|
205
|
-
```markdown
|
|
206
|
-
Check out our [Installation Guide](/guide/installation) for setup instructions.
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
## What's Next?
|
|
210
|
-
|
|
211
|
-
Now that you understand the basics:
|
|
212
|
-
|
|
213
|
-
1. **[Configuration](/guide/configuration)** - Learn about all available options
|
|
214
|
-
2. **[Advanced Features](/advanced/customization)** - Customize your site further
|
|
215
|
-
3. **[Deployment](/advanced/deployment)** - Deploy your site to production
|
|
216
|
-
|
|
217
|
-
Happy documenting! 🚀
|
|
1
|
+
# Quick Start
|
|
2
|
+
|
|
3
|
+
This guide will walk you through creating, configuring, and running your own React documentation website from scratch in 5 minutes.
|
|
4
|
+
|
|
5
|
+
## 1. Create the Project
|
|
6
|
+
|
|
7
|
+
Using the official scaffolding tool is the most efficient way. Open your terminal and run the following command:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# This creates a project named "my-awesome-docs"
|
|
11
|
+
npx create-react-docs-ui@latest my-awesome-docs
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Next, enter the project directory and install the dependencies:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
cd my-awesome-docs
|
|
18
|
+
npm install
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## 2. Organize Your Documents
|
|
22
|
+
|
|
23
|
+
All your documentation content is stored as Markdown files in the `public/docs/` directory.
|
|
24
|
+
|
|
25
|
+
- Open the `public/docs/en/` directory.
|
|
26
|
+
- You can modify the existing `index.md` and files under the `guide` directory, or create new `.md` files.
|
|
27
|
+
|
|
28
|
+
For example, let's create a new page. Create a new file named `about.md` in `public/docs/en/`:
|
|
29
|
+
|
|
30
|
+
```markdown
|
|
31
|
+
---
|
|
32
|
+
title: About Us
|
|
33
|
+
description: This is a page about our team.
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
# About Us
|
|
37
|
+
|
|
38
|
+
We love open source and creation!
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Note**: You can use `frontmatter` at the top of your Markdown files to define the page `title` and `description`.
|
|
42
|
+
|
|
43
|
+
## 3. Configure the Website
|
|
44
|
+
|
|
45
|
+
Now, let's display the newly created page by modifying the configuration file.
|
|
46
|
+
|
|
47
|
+
Open the core configuration file `public/config/site.yaml`.
|
|
48
|
+
|
|
49
|
+
### a. Modify Site Information
|
|
50
|
+
|
|
51
|
+
Update the `site` section to give your website a new title and logo.
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
site:
|
|
55
|
+
title: "My Awesome Docs"
|
|
56
|
+
description: "A website built with React Docs UI"
|
|
57
|
+
logo: "🚀" # You can use an emoji or an image path
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### b. Add to the Navbar
|
|
61
|
+
|
|
62
|
+
In the `navbar.items` array, add a link for the "About" page. Remember to update the links for the English version.
|
|
63
|
+
|
|
64
|
+
```yaml
|
|
65
|
+
navbar:
|
|
66
|
+
items:
|
|
67
|
+
- title: "Home"
|
|
68
|
+
link: "/en/"
|
|
69
|
+
- title: "Guide"
|
|
70
|
+
link: "/en/guide/introduction"
|
|
71
|
+
- title: "About" # New
|
|
72
|
+
link: "/en/about" # New
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### c. Add to the Sidebar
|
|
76
|
+
|
|
77
|
+
To make the "About" page visible in the sidebar, we'll add a new entry in `sidebar.collections.guide.sections`. Make sure to use English paths.
|
|
78
|
+
|
|
79
|
+
```yaml
|
|
80
|
+
sidebar:
|
|
81
|
+
collections:
|
|
82
|
+
guide:
|
|
83
|
+
sections:
|
|
84
|
+
- title: "Getting Started"
|
|
85
|
+
path: "/en/guide"
|
|
86
|
+
children:
|
|
87
|
+
- title: "Introduction"
|
|
88
|
+
path: "/en/guide/introduction"
|
|
89
|
+
- title: "Installation"
|
|
90
|
+
path: "/en/guide/installation"
|
|
91
|
+
- title: "Quick Start"
|
|
92
|
+
path: "/en/guide/quick-start"
|
|
93
|
+
# You can create a new section for the "About" page
|
|
94
|
+
- title: "About Us"
|
|
95
|
+
path: "/en/about"
|
|
96
|
+
children:
|
|
97
|
+
- title: "About"
|
|
98
|
+
path: "/en/about"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## 4. Launch the Website
|
|
102
|
+
|
|
103
|
+
Save all your changes and run the following command in your terminal:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
npm run dev
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Your website should now be running at `http://localhost:5173`. Visit it, and you will see the updated title, logo, and the new "About" link in the navbar and sidebar. Congratulations, you have successfully mastered the basic workflow of React Docs UI!
|
|
@@ -1,31 +1,10 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
-
|
|
11
|
-
- 📱 **Responsive Design** - Perfect adaptation to all devices
|
|
12
|
-
- 🎨 **Highly Customizable** - Flexible theme and style configuration
|
|
13
|
-
- 📝 **Markdown Support** - Use familiar Markdown syntax
|
|
14
|
-
|
|
15
|
-
## Learning Path
|
|
16
|
-
|
|
17
|
-
### [📖 Introduction](/guide/introduction)
|
|
18
|
-
Learn about Vue Docs UI's core concepts and features
|
|
19
|
-
|
|
20
|
-
### [⚡ Installation](/guide/installation)
|
|
21
|
-
Learn how to install and set up Vue Docs UI
|
|
22
|
-
|
|
23
|
-
### [🏃♂️ Quick Start](/guide/quick-start)
|
|
24
|
-
Get hands-on experience through practical examples
|
|
25
|
-
|
|
26
|
-
### [⚙️ Configuration](/guide/configuration)
|
|
27
|
-
Deep dive into configuration options and customization methods
|
|
28
|
-
|
|
29
|
-
## Ready to Start?
|
|
30
|
-
|
|
31
|
-
Choose any of the topics above to begin your learning journey, or jump directly to [Quick Start](/guide/quick-start) to experience it immediately!
|
|
1
|
+
# Guide
|
|
2
|
+
|
|
3
|
+
This guide will help you fully understand and master all the features of React Docs UI. Whether you are a beginner or looking for in-depth customization, you will find the information you need here.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- **[Introduction](/en/guide/introduction)**: Learn about the core philosophy and main advantages of React Docs UI.
|
|
8
|
+
- **[Installation](/en/guide/installation)**: Learn how to install via the scaffolding tool or manually.
|
|
9
|
+
- **[Quick Start](/en/guide/quick-start)**: Create and run your first documentation website in 5 minutes.
|
|
10
|
+
- **[Configuration (`site.yaml`)](/en/guide/configuration)**: Dive deep into each configuration option to take full control of your site.
|
|
@@ -1,58 +1,34 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
##
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
# Start development server
|
|
36
|
-
npm run dev
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## 📖 Usage
|
|
40
|
-
|
|
41
|
-
```javascript
|
|
42
|
-
import { createDocsApp } from 'vue-docs-ui'
|
|
43
|
-
import 'vue-docs-ui/dist/vue-docs-ui.css'
|
|
44
|
-
|
|
45
|
-
createDocsApp({
|
|
46
|
-
configPath: '/config/site.yaml',
|
|
47
|
-
el: '#app'
|
|
48
|
-
})
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
It's that simple! No complex configuration needed, get a fully functional documentation website immediately.
|
|
52
|
-
|
|
53
|
-
## 🔗 Related Links
|
|
54
|
-
|
|
55
|
-
- [GitHub Repository](https://github.com/shenjianZ/vue-docs-ui)
|
|
56
|
-
- [Online Demo](https://vue-docs-ui.example.com)
|
|
57
|
-
- [User Guide](/guide/introduction)
|
|
58
|
-
- [API Documentation](/advanced/api)
|
|
1
|
+
# React Docs UI
|
|
2
|
+
|
|
3
|
+
A **configuration-driven** modern documentation website builder based on React.
|
|
4
|
+
|
|
5
|
+
React Docs UI aims to make creating beautiful, powerful documentation websites simpler than ever. You just need to focus on writing Markdown documents, and everything else—from routing and navigation to theme switching and the command menu—is driven by a simple YAML configuration.
|
|
6
|
+
|
|
7
|
+
## Core Features
|
|
8
|
+
|
|
9
|
+
- **Configuration-Driven**: Define your entire website via `site.yaml` without coding.
|
|
10
|
+
- **Out-of-the-Box**: Quickly start your project with all necessary features built-in.
|
|
11
|
+
- **Modern Design**: Elegant responsive layout with automatic light/dark theme switching.
|
|
12
|
+
- **Command Menu**: Built-in `Cmd+K` shortcut menu for quick page access.
|
|
13
|
+
- **Markdown Support**: Full support for GFM and Frontmatter.
|
|
14
|
+
- **Internationalization**: Easily implement multi-language support through configuration files.
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
|
|
18
|
+
Get your own documentation website with just one command:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Create the project
|
|
22
|
+
npx create-react-docs-ui@latest my-docs
|
|
23
|
+
|
|
24
|
+
# Enter the project directory
|
|
25
|
+
cd my-docs
|
|
26
|
+
|
|
27
|
+
# Install dependencies and start
|
|
28
|
+
npm install && npm run dev
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Links
|
|
32
|
+
|
|
33
|
+
- **[Guide](/en/guide/introduction)**: Start learning about all the features of React Docs UI.
|
|
34
|
+
- **[GitHub](https://github.com/shenjianZ/react-docs-ui)**: View the source code, submit issues, or contribute.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 配置文件 (`site.yaml`) 详解
|
|
2
2
|
|
|
3
|
-
`
|
|
3
|
+
`react-docs-ui` 的核心是其**配置驱动**的理念。你几乎可以通过 `public/config/site.yaml` 这一个文件来定义整个网站的外观和行为。本文档将详细解释每个配置项。
|
|
4
4
|
|
|
5
5
|
## 顶级配置项概览
|
|
6
6
|
|
|
@@ -12,9 +12,6 @@
|
|
|
12
12
|
| `theme` | 配置网站的主题,如颜色、浅色/深色模式。 |
|
|
13
13
|
| `footer` | 配置网站底部的页脚信息。 |
|
|
14
14
|
| `toc` | 配置文章页面右侧的目录(Table of Contents)。 |
|
|
15
|
-
| `search` | 配置内置的全文搜索功能。 |
|
|
16
|
-
| `pwa` | 配置渐进式Web应用(PWA)相关设置。 |
|
|
17
|
-
| `ai` | 配置 AI 助手功能。 |
|
|
18
15
|
|
|
19
16
|
---
|
|
20
17
|
|
|
@@ -24,15 +21,15 @@
|
|
|
24
21
|
|
|
25
22
|
| 字段 | 说明 | 示例 |
|
|
26
23
|
| :--- | :--- | :--- |
|
|
27
|
-
| `title` | 网站标题,显示在浏览器标签页上。 | `"
|
|
28
|
-
| `description` | 网站描述,用于搜索引擎优化 (SEO)。 | `"一个
|
|
29
|
-
| `logo` | 网站 Logo,显示在导航栏左上角。 | `"📚"` 或 `"/images/logo.png"` |
|
|
30
|
-
| `author` | 网站作者。 | `"
|
|
24
|
+
| `title` | 网站标题,显示在浏览器标签页上。 | `"React Docs UI"` |
|
|
25
|
+
| `description` | 网站描述,用于搜索引擎优化 (SEO)。 | `"一个 React 文档网站构建工具"` |
|
|
26
|
+
| `logo` | 网站 Logo,显示在导航栏左上角。 | `"📚"` 或 `"/images/logo.png"` 或一个包含 `light` 和 `dark` 模式图片路径的对象 |
|
|
27
|
+
| `author` | 网站作者。 | `"React Docs UI Team"` |
|
|
31
28
|
|
|
32
29
|
**Logo 格式说明:**
|
|
33
30
|
1. **Emoji**: 直接使用一个表情符号,如 `"🚀"`。
|
|
34
31
|
2. **本地图片**: 指向 `public` 目录下的图片路径,如 `"/images/logo.png"`。
|
|
35
|
-
3.
|
|
32
|
+
3. **亮/暗模式图片**: 一个对象,包含 `light` 和 `dark` 两个键,分别指向不同主题下的图片路径。
|
|
36
33
|
|
|
37
34
|
---
|
|
38
35
|
|
|
@@ -43,6 +40,7 @@
|
|
|
43
40
|
| 字段 | 说明 |
|
|
44
41
|
| :--- | :--- |
|
|
45
42
|
| `items` | 导航项数组,定义了导航栏中显示的所有链接。 |
|
|
43
|
+
| `actions` | (可选) 导航栏右侧的操作按钮,如 GitHub 链接。 |
|
|
46
44
|
|
|
47
45
|
### `navbar.items`
|
|
48
46
|
|
|
@@ -56,13 +54,15 @@
|
|
|
56
54
|
|
|
57
55
|
## `sidebar`
|
|
58
56
|
|
|
59
|
-
|
|
57
|
+
侧边栏导航配置,是文档结构的核心。它使用 `collections` 来组织不同部分的内容。
|
|
60
58
|
|
|
61
59
|
| 字段 | 说明 |
|
|
62
60
|
| :--- | :--- |
|
|
63
|
-
| `
|
|
61
|
+
| `collections` | 一个对象,键是集合的名称(通常对应一级路由,如 `guide`),值是该集合的侧边栏配置。 |
|
|
64
62
|
|
|
65
|
-
### `sidebar.sections`
|
|
63
|
+
### `sidebar.collections.<name>.sections`
|
|
64
|
+
|
|
65
|
+
每个集合包含一个 `sections` 数组,每个 `section` 代表一个可折叠的菜单组。
|
|
66
66
|
|
|
67
67
|
| 字段 | 说明 | 示例 |
|
|
68
68
|
| :--- | :--- | :--- |
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
| `path` | 区域的基础路径。当用户访问的 URL 以此路径开头时,该区域会自动展开并高亮。 | `"/guide"` |
|
|
71
71
|
| `children` | 该区域下的子链接数组。 | |
|
|
72
72
|
|
|
73
|
-
### `sidebar.sections.children`
|
|
73
|
+
### `sidebar.collections.<name>.sections.children`
|
|
74
74
|
|
|
75
75
|
| 字段 | 说明 | 示例 |
|
|
76
76
|
| :--- | :--- | :--- |
|
|
@@ -85,9 +85,8 @@
|
|
|
85
85
|
|
|
86
86
|
| 字段 | 说明 | 可选值 | 默认值 |
|
|
87
87
|
| :--- | :--- | :--- | :--- |
|
|
88
|
-
| `defaultMode` | 网站的默认主题模式。 | `'light'`, `'dark'`, `'
|
|
88
|
+
| `defaultMode` | 网站的默认主题模式。 | `'light'`, `'dark'`, `'system'` | `'system'` |
|
|
89
89
|
| `allowToggle` | 是否允许用户切换主题。 | `true`, `false` | `true` |
|
|
90
|
-
| `primaryColor`| 网站的主题色。 | CSS 颜色值 | `"#3b82f6"` |
|
|
91
90
|
|
|
92
91
|
---
|
|
93
92
|
|
|
@@ -110,14 +109,6 @@
|
|
|
110
109
|
| `branch` | 文档所在的 Git 分支。 | `"main"` |
|
|
111
110
|
| `dir` | 文档文件在仓库中的根目录。 | `"docs/src"` |
|
|
112
111
|
|
|
113
|
-
### `footer.social`
|
|
114
|
-
|
|
115
|
-
| 字段 | 说明 | 示例 |
|
|
116
|
-
| :--- | :--- | :--- |
|
|
117
|
-
| `name` | 社交媒体名称,用于 `aria-label`。 | `"GitHub"` |
|
|
118
|
-
| `url` | 链接地址。 | `"https://github.com/user"` |
|
|
119
|
-
| `icon` | 图标标识符,支持 `github`, `twitter`, `discord` 等。 | `"github"` |
|
|
120
|
-
|
|
121
112
|
---
|
|
122
113
|
|
|
123
114
|
## `toc` (Table of Contents)
|
|
@@ -129,41 +120,3 @@
|
|
|
129
120
|
| `enabled` | 是否启用页面目录功能。 | `true` |
|
|
130
121
|
| `maxLevel` | 在目录中显示的最大标题级别(h1-h6)。 | `3` |
|
|
131
122
|
| `title` | 目录组件的标题。 | `"本页内容"` |
|
|
132
|
-
|
|
133
|
-
---
|
|
134
|
-
|
|
135
|
-
## `search`
|
|
136
|
-
|
|
137
|
-
内置搜索功能配置。
|
|
138
|
-
|
|
139
|
-
| 字段 | 说明 | 示例 |
|
|
140
|
-
| :--- | :--- | :--- |
|
|
141
|
-
| `enabled` | 是否启用搜索功能。 | `true` |
|
|
142
|
-
| `placeholder` | 搜索框的占位文本。 | `"搜索文档..."` |
|
|
143
|
-
|
|
144
|
-
---
|
|
145
|
-
|
|
146
|
-
## `pwa`
|
|
147
|
-
|
|
148
|
-
渐进式Web应用配置。
|
|
149
|
-
|
|
150
|
-
| 字段 | 说明 | 示例 |
|
|
151
|
-
| :--- | :--- | :--- |
|
|
152
|
-
| `enabled` | 是否启用 PWA 功能。 | `true` |
|
|
153
|
-
| `name` | PWA 的完整名称。 | `"Vue Docs UI"` |
|
|
154
|
-
| `shortName` | PWA 的短名称。 | `"VueDocs"` |
|
|
155
|
-
|
|
156
|
-
---
|
|
157
|
-
|
|
158
|
-
## `ai`
|
|
159
|
-
|
|
160
|
-
AI 助手配置。
|
|
161
|
-
|
|
162
|
-
| 字段 | 说明 | 示例 |
|
|
163
|
-
| :--- | :--- | :--- |
|
|
164
|
-
| `enabled` | 是否启用 AI 助手功能。 | `true` |
|
|
165
|
-
| `buttonTitle` | 浮动按钮的标题。 | `"AI 助手"` |
|
|
166
|
-
| `modalTitle` | 对话框的标题。 | `"与 AI 对话"` |
|
|
167
|
-
| `placeholder` | 输入框的占位文本。 | `"向我提问..."` |
|
|
168
|
-
|
|
169
|
-
**注意**: AI 功能的 `provider` 和 `apiKey` 等敏感信息在 `public/config/ai.json` 中单独配置,以避免意外泄露。
|