外观
我爱机器人 · vitallab.cn
VitePress 静态站点。线上根目录:/var/www/vitallab。
目录结构
text
.
├── .vitepress/
│ ├── config.mts # 站点配置(导航、侧边栏、SEO、sitemap)
│ └── theme/
│ ├── index.ts # 继承默认主题
│ ├── Layout.vue # 注入底部备案号(全站生效)
│ └── custom.css # 备案栏与首页样式
├── index.md # 首页
├── about.md # 关于本站 + 备案信息
├── notes/ # 学习笔记
├── public/ # 原样拷贝的静态资源(favicon/logo/robots.txt)
└── deploy.sh # 构建产物同步 + nginx 切换(需 root)本地开发
bash
npm run dev # http://localhost:5173
npm run build # 产物在 .vitepress/dist
npm run preview # 预览构建结果部署
bash
npm run build
sudo bash deploy.shdeploy.sh 做的事:
- 清空并同步
.vitepress/dist到/var/www/vitallab; - 备份
/etc/nginx/conf.d/vllm-https.conf; - 把
root指向新目录、启用index.html、try_files支持 cleanUrls、挂 404 页; nginx -t校验,失败自动回滚,成功则systemctl reload nginx。
不会改动 /v1/(vLLM)、/comfyui/(MiniMax)、/certd/ 等既有 location。
备案要求
- 备案号
京ICP备2024101927号由.vitepress/theme/Layout.vue的layout-bottom插槽渲染, 居中显示在每个页面底部,并链接 https://beian.miit.gov.cn ; - 修改备案号时只改
Layout.vue一处即可(about.md中的备案信息也建议同步更新); - 站点必须有实际内容,新增页面放在
notes/下并在config.mts的侧边栏里登记。