Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,20 @@ Every chapter follows this structure:

### 2.4 Cross-references

- Reference other chapters by file: `[Building Blocks](02-building-blocks.md)`
- Reference sections within a chapter by heading anchor: `[Tag Object](#tag-object-labels)`
- Markdown links must use the **URL path** (driven by `section` frontmatter),
not the filesystem path — the remark plugin
(`astro-site/src/plugins/remark-rewrite-links.ts`) rewrites links at
build time
- Recipe pages live in `chapters/recipes/` but their URLs are
`/playbook/...` — link to them as `playbook/X.md`, not `recipes/X.md`
- The remark plugin (`astro-site/src/plugins/remark-rewrite-links.ts`)
rewrites `.md` links at build time — use the correct format depending
on source and target:

| From → To | Link format | Example |
|-----------|-------------|---------|
| Chapter → chapter | `NN-slug.md` | `[Glossary](09-glossary.md)` → `../glossary/` |
| Chapter → recipe | `playbook/slug.md` | `[Debugging](playbook/debugging.md)` → `../playbook/debugging/` |
| Recipe → recipe | `../slug/` (raw URL) | `[Hooks](../hooks/)` — rewriter ignores it, browser resolves correctly |

- **Never use `slug.md`** for recipe-to-recipe links — the sibling
rewriter turns it into `slug/` which resolves to
`/playbook/current/slug/` instead of `/playbook/slug/`

### 2.5 Images

Expand Down
Loading