CLAUDE.md
CLAUDE.md
项目概述
个人博客源码仓库(私有),使用 Jekyll (Minimal Mistakes fork) 构建。
- 私有源码仓库:
hwb96/hwb96.github.io-src(当前仓库) - 公开部署仓库:
hwb96/hwb96.github.io(GitHub Pages 自动部署)
本仓库 push 到 main 分支后,CI 通过 repository_dispatch 事件触发公开仓库的 Pages 构建流水线。
文章与图片
文章位置
文章放在 _posts/ 目录下,文件名格式:YYYY-MM-DD-slug.md
YAML Front Matter 示例:
---
title: "文章标题"
date: 2026-05-18 00:00:00 +0800
---
正文中 <!--more--> 之前的内容作为首页摘要展示。
图片位置
文章引用的图片放在 images/ 目录下,按文章建对应的 assets 子目录:
images/YYYY-MM-DD-slug.assets/image-xxx.png
文章中引用图片使用绝对路径:

注意:路径以 /images/ 开头(对应仓库顶层 images/ 目录),不是相对路径 ./。
CI/CD
触发流程
push to main → .github/workflows/trigger-public-deploy.yml
→ gh api repos/hwb96/hwb96.github.io/dispatches (event_type: src-updated)
→ 公开仓库 GitHub Actions 拉取本仓库构建 → GitHub Pages 部署
push 后检查 CI 状态
push 到 main 后,使用 GitHub CLI 检查 CI 是否成功:
# 查看最新 workflow run
gh run list -R hwb96/hwb96.github.io-src -L 1
# 查看特定 run 的状态
gh run view <run-id> -R hwb96/hwb96.github.io-src
# 等待当前 run 完成并查看结果
gh run watch -R hwb96/hwb96.github.io-src
本地预览
Docker 方式(推荐):
docker compose up -d # 启动,访问 http://127.0.0.1:4000/
docker compose logs -f # 查看日志
docker compose down # 停止
本地 Ruby 方式:
/opt/homebrew/opt/ruby@3.2/bin/bundle install
/opt/homebrew/opt/ruby@3.2/bin/bundle exec jekyll serve --livereload --host 127.0.0.1 --port 4000
备注
- 仓库中保留了历史 Hugo 文件(
content/、hugo.toml等),当前以 Jekyll 为准 _config.yml中 exclude 了 Hugo 相关目录,Jekyll 构建时会忽略它们<!--excerpt-->是 Jekyll 的摘要分隔符(配置在_config.yml中),但文章中使用<!--more-->实际也可生效