CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Jekyll 个人站 / 技术博客。正式入口是自己的服务器,GitHub Pages 只作备份。
线上入口
| 用途 | 地址 |
|---|---|
| 个人站(长期) | https://me.bitgong.cn |
| 首页(临时,同一套文件) | https://bitgong.cn / https://www.bitgong.cn |
| GitHub Pages 备份 | https://gongxh0901.github.io |
_config.yml 的 url 必须是 https://me.bitgong.cn,baseurl 为空。不要改回 github.io。
服务器运维(1Panel、证书、DNS、OpenClaw)在仓库 ~/AI/openclaw-tengxun,不在本仓库改。
常用命令
依赖装在 vendor/bundle,不要装到系统 gem。
bundle config set --local path vendor/bundle
bundle install
# 本地预览(覆盖 url 为 localhost)
bundle exec jekyll serve --config _config.yml,_config_dev.yml --host=127.0.0.1 --port=4000 --livereload
# 生产构建
bundle exec jekyll build
# 清缓存
bundle exec jekyll clean
本地预览:http://localhost:4000
Jekyll 锁在 ~> 3.10.0。不要升到 4,Dart Sass 会把现有 SCSS 编挂。不要加回 github-pages gem,本机 Ruby 4 装不上那条依赖链。
部署
推 main 即自动构建并部署(GitHub Pages 备份 + 服务器正式入口)。完整流程、服务器目录、SSH、紧急手传见 @docs/部署.md。
结构
_posts/{blog-articles,dev-tools,game-projects,opensource}/:文章,文件名YYYY-MM-DD-标题.md_layouts/homepage.html:首页;category.html:博客分类列表(技术文章/游戏项目/开发工具/开源项目);post.html:文章页;page.html:关于我、404_includes/site-nav.html:全站顶部导航;footer.html:页脚_data/navigation.yml:顶部导航与首页分类入口;_data/projects.yml:首页精选项目blog/{articles,projects,tools,opensource}.md:四个分类页,layout: categorypermalink:/posts/:title/,文章 URL 不含分类前缀
新文章写在对应分类目录,Front Matter 用 layout: post,摘要统一用 excerpt 字段(120-160 字符)。图片走 /assets/images/...。细则见 docs/新增文章指南.md。
博客已改为标准多页结构,不再是单页 SPA。/blog/ 是重定向页,跳转到 /blog/articles/。
提交
中文 subject,格式 type(scope): 描述。文章用 post(article|project|tool|opensource)。推 main 即部署,确认 Actions 里 deploy-server 通过。完整 type/scope 列表见 @.claude/rules/git-commit.md。
规则文件
- @.claude/rules/writing-style.md:文章写作语气、结构、SEO 要点
- @.claude/rules/code-style.md:JS/SCSS/Liquid 代码风格
- @.claude/rules/git-commit.md:commit type/scope 完整列表