vitepress/README.md

60 lines
1.0 KiB
Markdown
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.

# OneinAI 文档站
基于 VitePress 构建的文档站点。
## 本地启动
```bash
# 安装依赖
npm install
# 启动开发服务器
npm run docs:dev
```
访问 http://localhost:5173 查看效果。
## 构建
```bash
npm run docs:build
```
构建产物在 `apidoc/.vitepress/dist/` 目录。
## 部署到宝塔
### 1. 本地构建
```bash
npm run docs:build
```
### 2. 宝塔添加站点
1. 宝塔面板 → **网站****添加站点**
2. 填写域名PHP 版本选 **纯静态**
3. 记住站点根目录路径(如 `/www/wwwroot/你的域名/`
### 3. 上传文件
将本地 `apidoc/.vitepress/dist/` 目录下的**所有文件**上传到站点根目录。
可使用宝塔文件管理器或 FTP 工具上传。
### 4. 配置 Nginx
进入站点 **设置 → 配置文件**,找到 `location /` 块,修改为:
```nginx
location / {
try_files $uri $uri/ /index.html;
}
```
保存后重载 Nginx站点即可正常访问。
### 5. 后续更新
每次修改文档后重新执行构建,将新的 `dist/` 内容覆盖上传即可。