This file provides guidance to LLM agent when working with code in this repository.
This is a personal blog built with Docusaurus 3.7.0, configured for Chinese language content (zh-Hans). The site is deployed automatically to Cloudflare for both feature branches and main branch.
npm install- Install dependencies (requires Node.js >= 18.0)npm run start- Start development server with hot reloadnpm run serve- Serve production build locallynpm run typecheck- Run TypeScript type checking
npm run build- Build static site tobuild/directorynpm run clear- Clear Docusaurus cachenpm run deploy- Deploy to GitHub Pages (if configured)
make md-padding- Format all Markdown files using md-padding toolmake list-md- List all Markdown files that will be processednpm run write-translations- Generate translation filesnpm run write-heading-ids- Add heading IDs to markdown filesnpm run generate-places- Generate places.ts data from places-source.yml
目的: 简化地点数据录入,自动获取坐标。
流程:
- 编辑
src/data/places-source.yml添加新地点 - 只需输入: 名称(name)、初次访问日期(firstVisitDate)、备注(description)
- 运行
npm run generate-places自动生成坐标和 places.ts
数据格式 (places-source.yml):
- name: 上海市
firstVisitDate: 2024-05-01 # 或 2024-05(精确到月)
description: 2024年5月上海之行
- name: 北京市
firstVisitDate: 2023-10说明:
- 坐标通过 OpenStreetMap Nominatim API 自动获取(免费,无需 API Key)
- 常见城市名称会自动添加英文名称
- 生成的 places.ts 包含完整坐标数据,可直接使用
- 避免手动查找坐标,减少错误
依赖: js-yaml, @types/js-yaml, ts-node
- Main config:
docusaurus.config.ts- Primary Docusaurus configuration with site metadata, theme settings, and plugin configuration - TypeScript: Uses
@docusaurus/tsconfigwith base URL set to project root - Localization: Configured for Chinese (zh-Hans) as default and only locale
- Blog-only site: Documents feature disabled (
docs: false), focuses solely on blog content - Blog structure: Multi-part articles supported via subdirectories (e.g.,
blog/2025-05-09-bcm-engine/) - Authors: Centrally managed in
blog/authors.ymlwith social links and metadata - Tags: Centrally defined in
blog/tags.ymlwith descriptions and permalinks - Custom reading time: Set to 1000 words per minute for Chinese content
- Mermaid support: Enabled via
@docusaurus/theme-mermaidfor diagram rendering - Dual themes: GitHub (light) and Dracula (dark) Prism themes
- Table of contents: Configured for heading levels 2-5
- Edit links: Point to GitHub repository main branch
- Pre-commit hooks: Husky configured to run lint-staged
- Linting pipeline:
md-paddingfor Markdown filesprettier --write --ignore-unknownfor all files
- File exclusions:
.docusaurus/andbuild/directories excluded from TypeScript compilation - DCO (Developer Certificate of Origin): This project requires DCO compliance for all commits
-
ALWAYS use
-sflag when committing:git commit -m "message" -s -
This automatically adds the
Signed-off-by: Author Name <author@email>line -
Example:
git commit -m "feat: add new feature" -s -
This results in commit message:
feat: add new feature Signed-off-by: Author Name <author@email> -
DO NOT manually add Signed-off-by lines - let git handle it with
-sflag -
This requirement applies to all commits, including those made by agents
-
- Blog posts support frontmatter with title, description, slug, tags, authors, and table of contents settings
- Multi-part series can be structured as subdirectories with cross-references
- Use
<!-- truncate -->comment to define excerpt boundaries - Images and static assets go in
static/directory
- Site URL:
https://spencercjh.me - Automatic deployment configured for Cloudflare
- GitHub organization:
spencercjh - Edit URLs point to GitHub repository for content collaboration
注意:Skills 需要手动安装到
skills/目录。该目录已加入.gitignore,不会被提交到 git。安装方式见各 skill 的说明。
安装方式:
git clone https://github.com/MrGeDiao/shuorenhua.git skills/shuorenhua用于检查和清理中文文本里的 AI 套路,让文本更自然、减少模板感。
触发条件:当用户说 "去 AI 味"、"说人话"、"自然一点"、"别像模板" 等类似需求时。
Skill 文件位置:skills/shuorenhua/SKILL.md
使用方式:
- 当涉及博客文章、文案、说明文本的改写时,参考
skills/shuorenhua/SKILL.md中的指导原则 - 该 skill 包含详细的场景判断、问题分级(Tier 1/2/3)和改写档位(minimal/standard/aggressive)
- 参考文件位于
skills/shuorenhua/references/目录,包含短语表、结构反模式、保护范围等内容