AGENTS.md — Blog Posts (content/posts/)
Overview
Blog post content organized by topic category. ~94 posts total. All new posts MUST be bilingual (zh + en).
Structure
| |
Each category may have an images/ subdirectory for post assets.
Where to Look
| Task | Location | Notes |
|---|---|---|
| Add new post | content/posts/<category>/<slug>.md | Pick matching category dir |
| Add new category | Create new subdir under posts/ | Lowercase name |
| Add post images | content/posts/<category>/images/ | Reference as /posts/<category>/images/file.png |
| Archive old post | Move to content/archives/ | Bilingual pairs .md + .en.md |
| Validate Mermaid | python scripts/check-mermaid.py content/posts/ | Run before commit |
Front Matter (YAML only)
All posts use YAML (---). Never use TOML (+++) despite the archetype.
Required: title, date
Common optional: categories, tags, comments, description, keywords, lastmod, toc, math, mermaid, draft, series, weight
| |
MANDATORY: Bilingual Posts
Every new blog post MUST be created as a pair:
content/posts/<category>/<slug>.md— Chinese versioncontent/posts/<category>/<slug>.en.md— English version
Both files must have identical front matter fields (with translated values).
Each category needs _index.md (zh) + _index.en.md (en) for section page titles.
MANDATORY: Series Weight
Posts in a series MUST use weight to control ordering (not date).
The series detail template sorts by .Pages.ByWeight.
Lower weight = earlier in series. Use 1, 2, 3, … to allow inserting in the middle later.
Content Rules
- Language: Chinese with inline English for technical terms
- Headings: Start at
##(h2) — h1 is the title - No manual numbering: TOC auto-numbers, avoid “一、二、” or “1. 2. 3.”
- Images: Store in category’s
images/dir, reference with absolute path - Code blocks: Triple backticks with language identifier
- Mermaid: Fenced
```mermaidblocks, setmermaid: truein front matter if needed
Anti-Patterns
- NEVER put posts in
content/posts/root — always use category subdirectory - NEVER create a single-language post — every post needs both
.mdand.en.md - NEVER use manual heading numbering
- NEVER put
config:/themeVariables:inside Mermaid code blocks - NEVER use
classDef/styleinsequenceDiagram— causes Parse error - NEVER use
@{ shape }outsideflowchart/graph - NEVER use TOML front matter (
+++) — always YAML (---)