外观
项目结构
本项目的目录和目标站几乎一一对应:
text
wk-docs/
├─ .vitepress/
│ ├─ config.ts # 站点配置:标题、导航、侧边栏、搜索
│ └─ theme/
│ ├─ index.ts # 主题入口,extends 默认主题
│ ├─ Layout.vue # 自定义布局,挂载 layout-top 插槽
│ ├─ style.css # 全局样式覆盖
│ └─ components/
│ ├─ MouseFollower.vue # 鼠标跟随拖尾
│ └─ ConfettiCanvas.vue # 彩纸特效
├─ public/
│ ├─ favicon.svg
│ └─ bg.svg # 首页 Hero 插图
├─ index.md # 首页
├─ syjc/ # 教程中心
├─ jczn/ # 进阶指南
├─ dj/ # 开发文档
└─ faq/ # 常见问题路由规则
VitePress 的路由非常直接:/syjc/ksss 对应 syjc/ksss.md。
目标站链接写成 /syjc/ksss.html 是因为它配置了 cleanUrls: false,构建后输出 .html 后缀。本项目用默认的 clean URL,链接写 /syjc/ksss 即可。
构建产物
bash
npm run build输出在 .vitepress/dist,里面全是静态文件——上传 nginx 的 html 目录就能访问,不需要 Node 服务常驻。