create-react-docs-ui 0.1.0
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/index.js +131 -0
- package/package.json +13 -0
- package/template/index.html +14 -0
- package/template/package.json +25 -0
- package/template/public/config/ai.json +60 -0
- package/template/public/config/site.en.yaml +137 -0
- package/template/public/config/site.yaml +137 -0
- package/template/public/docs/en/guide/configuration.md +69 -0
- package/template/public/docs/en/guide/installation.md +139 -0
- package/template/public/docs/en/guide/introduction.md +50 -0
- package/template/public/docs/en/guide/quick-start.md +217 -0
- package/template/public/docs/en/guide.md +31 -0
- package/template/public/docs/en/index.md +58 -0
- package/template/public/docs/zh-cn/guide/configuration.md +169 -0
- package/template/public/docs/zh-cn/guide/installation.md +66 -0
- package/template/public/docs/zh-cn/guide/introduction.md +29 -0
- package/template/public/docs/zh-cn/guide/quick-start.md +100 -0
- package/template/public/docs/zh-cn/guide.md +10 -0
- package/template/public/docs/zh-cn/index.md +34 -0
- package/template/public/images/favicon-dark.svg +7 -0
- package/template/public/images/favicon.svg +7 -0
- package/template/public/images/placeholder.md +25 -0
- package/template/src/main.tsx +16 -0
- package/template/src/vite-env.d.ts +3 -0
- package/template/tsconfig.app.json +26 -0
- package/template/tsconfig.json +8 -0
- package/template/vite.config.ts +15 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# Installation
|
|
2
|
+
|
|
3
|
+
Get Vue Docs UI up and running in your project with these simple steps.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
Before you begin, make sure you have the following installed:
|
|
7
|
+
|
|
8
|
+
- **Node.js** 14.18+ or 16+
|
|
9
|
+
- **npm** 6+ or **yarn** 1.22+
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
The fastest way to get started is using our CLI tool:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Create a new project
|
|
17
|
+
npm create vue-docs-ui@latest my-docs
|
|
18
|
+
|
|
19
|
+
# Navigate to your project
|
|
20
|
+
cd my-docs
|
|
21
|
+
|
|
22
|
+
# Install dependencies
|
|
23
|
+
npm install
|
|
24
|
+
|
|
25
|
+
# Start the development server
|
|
26
|
+
npm run dev
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Your documentation website will be running at `http://localhost:5173`!
|
|
30
|
+
|
|
31
|
+
## Manual Installation
|
|
32
|
+
|
|
33
|
+
If you prefer to set up Vue Docs UI manually in an existing project:
|
|
34
|
+
|
|
35
|
+
### 1. Install Vue Docs UI
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm install vue-docs-ui
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 2. Create Your App
|
|
42
|
+
|
|
43
|
+
Create a `main.ts` file:
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
import { createApp } from 'vue'
|
|
47
|
+
import { createRouter, createWebHistory } from 'vue-router'
|
|
48
|
+
import App from './App.vue'
|
|
49
|
+
|
|
50
|
+
const router = createRouter({
|
|
51
|
+
history: createWebHistory(),
|
|
52
|
+
routes: [
|
|
53
|
+
{ path: '/:pathMatch(.*)*', redirect: '/' }
|
|
54
|
+
]
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
const app = createApp(App)
|
|
58
|
+
app.use(router)
|
|
59
|
+
app.mount('#app')
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 3. Create App Component
|
|
63
|
+
|
|
64
|
+
Create an `App.vue` file:
|
|
65
|
+
|
|
66
|
+
```vue
|
|
67
|
+
<template>
|
|
68
|
+
<DocsLayout />
|
|
69
|
+
</template>
|
|
70
|
+
|
|
71
|
+
<script setup lang="ts">
|
|
72
|
+
import { DocsLayout } from 'vue-docs-ui'
|
|
73
|
+
import 'vue-docs-ui/style.css'
|
|
74
|
+
</script>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 4. Configure Your Site
|
|
78
|
+
|
|
79
|
+
Create a `public/config/site.yaml` file with your site configuration:
|
|
80
|
+
|
|
81
|
+
```yaml
|
|
82
|
+
site:
|
|
83
|
+
title: "My Documentation"
|
|
84
|
+
description: "My awesome documentation website"
|
|
85
|
+
logo: "📚"
|
|
86
|
+
author: "Your Name"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### 5. Add Your Content
|
|
90
|
+
|
|
91
|
+
Create your documentation files in the `public/docs/` directory as Markdown files.
|
|
92
|
+
|
|
93
|
+
## Project Structure
|
|
94
|
+
|
|
95
|
+
After installation, your project structure should look like this:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
my-docs/
|
|
99
|
+
├── public/
|
|
100
|
+
│ ├── config/
|
|
101
|
+
│ │ └── site.yaml
|
|
102
|
+
│ └── docs/
|
|
103
|
+
│ └── guide/
|
|
104
|
+
│ └── introduction.md
|
|
105
|
+
├── src/
|
|
106
|
+
│ ├── App.vue
|
|
107
|
+
│ └── main.ts
|
|
108
|
+
├── index.html
|
|
109
|
+
├── package.json
|
|
110
|
+
└── vite.config.js
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Development
|
|
114
|
+
|
|
115
|
+
Start the development server:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
npm run dev
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Your site will be available at `http://localhost:5173` with hot reload enabled.
|
|
122
|
+
|
|
123
|
+
## Building for Production
|
|
124
|
+
|
|
125
|
+
Build your documentation for production:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
npm run build
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
The built files will be in the `dist/` directory, ready to deploy to any static hosting service.
|
|
132
|
+
|
|
133
|
+
## Next Steps
|
|
134
|
+
|
|
135
|
+
- [Quick Start Guide](/guide/quick-start) - Learn the basics
|
|
136
|
+
- [Configuration](/guide/configuration) - Customize your site
|
|
137
|
+
- [Examples](/examples) - See Vue Docs UI in action
|
|
138
|
+
|
|
139
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Introduction
|
|
2
|
+
|
|
3
|
+
Welcome to **Vue Docs UI** - the simplest way to create beautiful documentation websites with Vue.js!
|
|
4
|
+
|
|
5
|
+
## What is Vue Docs UI?
|
|
6
|
+
|
|
7
|
+
Vue Docs UI is a modern, lightweight, and highly customizable documentation framework built with Vue 3 and TypeScript. It helps you create professional documentation websites with minimal setup and maximum flexibility.
|
|
8
|
+
|
|
9
|
+
## Key Features
|
|
10
|
+
|
|
11
|
+
### 🚀 **Quick Setup**
|
|
12
|
+
Get started in minutes with zero configuration required.
|
|
13
|
+
|
|
14
|
+
### 📱 **Responsive Design**
|
|
15
|
+
Looks great on all devices - from mobile phones to desktop computers.
|
|
16
|
+
|
|
17
|
+
### 🎨 **Customizable Themes**
|
|
18
|
+
Built-in light and dark themes with full customization support.
|
|
19
|
+
|
|
20
|
+
### 📝 **Markdown Support**
|
|
21
|
+
Write your documentation in Markdown with enhanced features.
|
|
22
|
+
|
|
23
|
+
### 🔍 **Built-in Search**
|
|
24
|
+
Powerful search functionality to help users find content quickly.
|
|
25
|
+
|
|
26
|
+
### ⚡ **Lightning Fast**
|
|
27
|
+
Built with Vite for incredibly fast development and build times.
|
|
28
|
+
|
|
29
|
+
## Why Vue Docs UI?
|
|
30
|
+
|
|
31
|
+
- **Developer Friendly**: Simple API and intuitive configuration
|
|
32
|
+
- **Production Ready**: Optimized for performance and SEO
|
|
33
|
+
- **Extensible**: Easy to customize and extend with your own components
|
|
34
|
+
- **Modern**: Built with the latest Vue 3 and TypeScript technologies
|
|
35
|
+
|
|
36
|
+
## Getting Started
|
|
37
|
+
|
|
38
|
+
Ready to create your first documentation website? Check out our [Installation Guide](/guide/installation) to get started in just a few minutes!
|
|
39
|
+
|
|
40
|
+
## Community
|
|
41
|
+
|
|
42
|
+
Join our growing community:
|
|
43
|
+
|
|
44
|
+
- 🐛 [Report Issues](https://github.com/shenjianZ/vue-docs-ui/issues)
|
|
45
|
+
- 💡 [Feature Requests](https://github.com/shenjianZ/vue-docs-ui/discussions)
|
|
46
|
+
- 📖 [Documentation](https://github.com/shenjianZ/vue-docs-ui)
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
*Happy documenting! 📚*
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# Quick Start
|
|
2
|
+
|
|
3
|
+
This guide will help you understand the basics of Vue Docs UI and get your documentation website up and running quickly.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
Vue Docs UI follows a simple file-based routing system. Your documentation is organized as:
|
|
8
|
+
|
|
9
|
+
- **Configuration**: `public/config/site.yaml` - Site settings and navigation
|
|
10
|
+
- **Content**: `public/docs/` - Markdown files for your documentation pages
|
|
11
|
+
- **Assets**: `public/images/` - Images and other static assets
|
|
12
|
+
|
|
13
|
+
## Writing Your First Page
|
|
14
|
+
|
|
15
|
+
Let's create a simple documentation page:
|
|
16
|
+
|
|
17
|
+
### 1. Create a Markdown File
|
|
18
|
+
|
|
19
|
+
Create a new file at `public/docs/my-first-page.md`:
|
|
20
|
+
|
|
21
|
+
```markdown
|
|
22
|
+
# My First Page
|
|
23
|
+
|
|
24
|
+
Welcome to my documentation! This is written in **Markdown**.
|
|
25
|
+
|
|
26
|
+
## Features
|
|
27
|
+
|
|
28
|
+
- Easy to write
|
|
29
|
+
- Supports code syntax highlighting
|
|
30
|
+
- Responsive design
|
|
31
|
+
- Built-in search
|
|
32
|
+
|
|
33
|
+
## Code Example
|
|
34
|
+
|
|
35
|
+
## Lists and More
|
|
36
|
+
|
|
37
|
+
1. Ordered lists work great
|
|
38
|
+
2. With automatic numbering
|
|
39
|
+
3. And proper styling
|
|
40
|
+
|
|
41
|
+
- Unordered lists too
|
|
42
|
+
- With bullet points
|
|
43
|
+
- And consistent spacing
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
> **Tip**: Use blockquotes for important notes and tips!
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### 2. Add to Navigation
|
|
50
|
+
|
|
51
|
+
Update your `public/config/site.yaml` to include the new page:
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
sidebar:
|
|
55
|
+
sections:
|
|
56
|
+
- title: "Getting Started"
|
|
57
|
+
path: "/guide"
|
|
58
|
+
children:
|
|
59
|
+
- title: "My First Page"
|
|
60
|
+
path: "/my-first-page"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### 3. View Your Page
|
|
64
|
+
|
|
65
|
+
Start the development server and navigate to your new page:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npm run dev
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Visit `http://localhost:5173/my-first-page` to see your page!
|
|
72
|
+
|
|
73
|
+
## Understanding Configuration
|
|
74
|
+
|
|
75
|
+
The `site.yaml` file controls your entire site structure:
|
|
76
|
+
|
|
77
|
+
### Site Settings
|
|
78
|
+
```yaml
|
|
79
|
+
site:
|
|
80
|
+
title: "Your Site Title"
|
|
81
|
+
description: "Site description for SEO"
|
|
82
|
+
logo: "📚" # Emoji, image URL, or path
|
|
83
|
+
author: "Your Name"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Navigation Bar
|
|
87
|
+
```yaml
|
|
88
|
+
navbar:
|
|
89
|
+
items:
|
|
90
|
+
- title: "Home"
|
|
91
|
+
link: "/"
|
|
92
|
+
- title: "GitHub"
|
|
93
|
+
link: "https://github.com/username/repo"
|
|
94
|
+
external: true
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Sidebar Navigation
|
|
98
|
+
```yaml
|
|
99
|
+
sidebar:
|
|
100
|
+
sections:
|
|
101
|
+
- title: "Section Name"
|
|
102
|
+
path: "/section"
|
|
103
|
+
children:
|
|
104
|
+
- title: "Page Title"
|
|
105
|
+
path: "/page-path"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Markdown Features
|
|
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! 🚀
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Getting Started
|
|
2
|
+
|
|
3
|
+
## Getting Started with Vue Docs UI
|
|
4
|
+
|
|
5
|
+
Welcome to Vue Docs UI! This is a modern documentation website building tool based on Vue 3.
|
|
6
|
+
|
|
7
|
+
## Quick Overview
|
|
8
|
+
|
|
9
|
+
Vue Docs UI enables you to:
|
|
10
|
+
- 🚀 **Quick Start** - Create beautiful documentation websites with just a few lines of code
|
|
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!
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Welcome to Vue Docs UI
|
|
2
|
+
|
|
3
|
+
Vue Docs UI is a modern documentation website builder based on Vue 3, providing an out-of-the-box documentation solution.
|
|
4
|
+
|
|
5
|
+
## 🌟 Key Features
|
|
6
|
+
|
|
7
|
+
- **🚀 Ready to Use** - Launch your documentation website with just 3 lines of code
|
|
8
|
+
- **🎨 Modern Design** - Beautiful interface design with light/dark theme support
|
|
9
|
+
- **📱 Mobile Responsive** - Perfect responsive design
|
|
10
|
+
- **🌐 Internationalization** - Built-in multi-language support
|
|
11
|
+
- **🤖 AI Assistant** - Integrated AI chat assistant with multiple model support
|
|
12
|
+
- **⚡ High Performance** - Built with Vite for fast hot reload
|
|
13
|
+
- **🔍 Full-text Search** - Smart search functionality
|
|
14
|
+
- **📝 Enhanced Markdown** - Rich Markdown extensions
|
|
15
|
+
|
|
16
|
+
## 🏗️ Architecture Features
|
|
17
|
+
|
|
18
|
+
- **Component-based Design** - Modular components, easy to extend
|
|
19
|
+
- **TypeScript Support** - Complete type support
|
|
20
|
+
- **Customizable Themes** - Flexible theme configuration
|
|
21
|
+
- **Plugin System** - Extensible plugin architecture
|
|
22
|
+
|
|
23
|
+
## 📦 Quick Start
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Create new project
|
|
27
|
+
npm create vue-docs-ui@latest my-docs
|
|
28
|
+
|
|
29
|
+
# Navigate to project directory
|
|
30
|
+
cd my-docs
|
|
31
|
+
|
|
32
|
+
# Install dependencies
|
|
33
|
+
npm install
|
|
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)
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# 配置文件 (`site.yaml`) 详解
|
|
2
|
+
|
|
3
|
+
`vue-docs-ui` 的核心是其**配置驱动**的理念。你几乎可以通过 `public/config/site.yaml` 这一个文件来定义整个网站的外观和行为。本文档将详细解释每个配置项。
|
|
4
|
+
|
|
5
|
+
## 顶级配置项概览
|
|
6
|
+
|
|
7
|
+
| 顶级字段 | 说明 |
|
|
8
|
+
| :--- | :--- |
|
|
9
|
+
| `site` | 网站的全局信息,如标题、描述、Logo。 |
|
|
10
|
+
| `navbar` | 配置网站顶部的导航栏。 |
|
|
11
|
+
| `sidebar` | 配置网站侧边栏的导航菜单。 |
|
|
12
|
+
| `theme` | 配置网站的主题,如颜色、浅色/深色模式。 |
|
|
13
|
+
| `footer` | 配置网站底部的页脚信息。 |
|
|
14
|
+
| `toc` | 配置文章页面右侧的目录(Table of Contents)。 |
|
|
15
|
+
| `search` | 配置内置的全文搜索功能。 |
|
|
16
|
+
| `pwa` | 配置渐进式Web应用(PWA)相关设置。 |
|
|
17
|
+
| `ai` | 配置 AI 助手功能。 |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## `site`
|
|
22
|
+
|
|
23
|
+
网站的基础元数据配置。
|
|
24
|
+
|
|
25
|
+
| 字段 | 说明 | 示例 |
|
|
26
|
+
| :--- | :--- | :--- |
|
|
27
|
+
| `title` | 网站标题,显示在浏览器标签页上。 | `"Vue Docs UI"` |
|
|
28
|
+
| `description` | 网站描述,用于搜索引擎优化 (SEO)。 | `"一个 Vue 3 文档网站构建工具"` |
|
|
29
|
+
| `logo` | 网站 Logo,显示在导航栏左上角。 | `"📚"` 或 `"/images/logo.png"` |
|
|
30
|
+
| `author` | 网站作者。 | `"Vue Docs UI Team"` |
|
|
31
|
+
|
|
32
|
+
**Logo 格式说明:**
|
|
33
|
+
1. **Emoji**: 直接使用一个表情符号,如 `"🚀"`。
|
|
34
|
+
2. **本地图片**: 指向 `public` 目录下的图片路径,如 `"/images/logo.png"`。
|
|
35
|
+
3. **外部图片 URL**: 一个完整的图片链接。
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## `navbar`
|
|
40
|
+
|
|
41
|
+
顶部导航栏配置。
|
|
42
|
+
|
|
43
|
+
| 字段 | 说明 |
|
|
44
|
+
| :--- | :--- |
|
|
45
|
+
| `items` | 导航项数组,定义了导航栏中显示的所有链接。 |
|
|
46
|
+
|
|
47
|
+
### `navbar.items`
|
|
48
|
+
|
|
49
|
+
| 字段 | 说明 | 示例 |
|
|
50
|
+
| :--- | :--- | :--- |
|
|
51
|
+
| `title` | 导航项的显示文本。 | `"指南"` |
|
|
52
|
+
| `link` | 链接地址。内部链接以 `/` 开头。 | `"/guide/introduction"` |
|
|
53
|
+
| `external` | (可选) `true` 表示为外部链接,将在新标签页打开。 | `true` |
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## `sidebar`
|
|
58
|
+
|
|
59
|
+
侧边栏导航配置,是文档结构的核心。
|
|
60
|
+
|
|
61
|
+
| 字段 | 说明 |
|
|
62
|
+
| :--- | :--- |
|
|
63
|
+
| `sections` | 侧边栏区域数组,每个区域代表一个可折叠的菜单组。 |
|
|
64
|
+
|
|
65
|
+
### `sidebar.sections`
|
|
66
|
+
|
|
67
|
+
| 字段 | 说明 | 示例 |
|
|
68
|
+
| :--- | :--- | :--- |
|
|
69
|
+
| `title` | 区域的标题。 | `"入门指南"` |
|
|
70
|
+
| `path` | 区域的基础路径。当用户访问的 URL 以此路径开头时,该区域会自动展开并高亮。 | `"/guide"` |
|
|
71
|
+
| `children` | 该区域下的子链接数组。 | |
|
|
72
|
+
|
|
73
|
+
### `sidebar.sections.children`
|
|
74
|
+
|
|
75
|
+
| 字段 | 说明 | 示例 |
|
|
76
|
+
| :--- | :--- | :--- |
|
|
77
|
+
| `title` | 子链接的显示文本。 | `"介绍"` |
|
|
78
|
+
| `path` | 子链接的完整路径,指向一个具体的 Markdown 页面。 | `"/guide/introduction"` |
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## `theme`
|
|
83
|
+
|
|
84
|
+
主题和外观配置。
|
|
85
|
+
|
|
86
|
+
| 字段 | 说明 | 可选值 | 默认值 |
|
|
87
|
+
| :--- | :--- | :--- | :--- |
|
|
88
|
+
| `defaultMode` | 网站的默认主题模式。 | `'light'`, `'dark'`, `'auto'` | `'auto'` |
|
|
89
|
+
| `allowToggle` | 是否允许用户切换主题。 | `true`, `false` | `true` |
|
|
90
|
+
| `primaryColor`| 网站的主题色。 | CSS 颜色值 | `"#3b82f6"` |
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## `footer`
|
|
95
|
+
|
|
96
|
+
页脚配置。
|
|
97
|
+
|
|
98
|
+
| 字段 | 说明 | 示例 |
|
|
99
|
+
| :--- | :--- | :--- |
|
|
100
|
+
| `copyright` | 版权信息。`{year}` 会被替换为当前年份。 | `"Copyright © {year} My Company"` |
|
|
101
|
+
| `repository` | (可选) 仓库信息,用于显示“在 GitHub 上编辑此页”等链接。 | |
|
|
102
|
+
| `links` | (可选) 在页脚显示的额外链接列。 | |
|
|
103
|
+
| `social` | (可选) 在页脚显示的社交媒体图标链接。 | |
|
|
104
|
+
|
|
105
|
+
### `footer.repository`
|
|
106
|
+
|
|
107
|
+
| 字段 | 说明 | 示例 |
|
|
108
|
+
| :--- | :--- | :--- |
|
|
109
|
+
| `url` | 仓库的 URL。 | `"https://github.com/user/repo"` |
|
|
110
|
+
| `branch` | 文档所在的 Git 分支。 | `"main"` |
|
|
111
|
+
| `dir` | 文档文件在仓库中的根目录。 | `"docs/src"` |
|
|
112
|
+
|
|
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
|
+
---
|
|
122
|
+
|
|
123
|
+
## `toc` (Table of Contents)
|
|
124
|
+
|
|
125
|
+
文章页面右侧的目录配置。
|
|
126
|
+
|
|
127
|
+
| 字段 | 说明 | 示例 |
|
|
128
|
+
| :--- | :--- | :--- |
|
|
129
|
+
| `enabled` | 是否启用页面目录功能。 | `true` |
|
|
130
|
+
| `maxLevel` | 在目录中显示的最大标题级别(h1-h6)。 | `3` |
|
|
131
|
+
| `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` 中单独配置,以避免意外泄露。
|