Skip to content

我爱机器人 · 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.sh

deploy.sh 做的事:

  1. 清空并同步 .vitepress/dist 到 /var/www/vitallab;
  2. 备份 /etc/nginx/conf.d/vllm-https.conf;
  3. 把 root 指向新目录、启用 index.html、try_files 支持 cleanUrls、挂 404 页;
  4. 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 的侧边栏里登记。

本站内容均为个人学习笔记与实践记录,欢迎交流指正。