/src/content/CLAUDE.md
CLAUDE.md at /src/content/CLAUDE.md
Path: src/
Doc Content (src/content/)
Writing rules for MDX content under docs/ (English) and docs-ja/ (Japanese). This file auto-loads when working on content files.
Bilingual Pairing
English:
docs/...(default locale, served at/)docs/ . . . Japanese:
docs-ja/...(served at/)ja/ docs/ . . . JA must mirror the EN directory structure.
When creating or updating any doc page, update both EN and JA versions. Keep code blocks identical — only translate prose.
Exceptions to bilingual rule
Pages with
generated: truein frontmatter do not require Japanese translations.Pages whose paths fall under
settings.defaultLocaleOnlyPrefixesare default-locale-only by design — no JA mirror should be created for them. Current entries:/,docs/ claude- md/ /,docs/ claude- skills/ /,docs/ claude- agents/ /.docs/ claude- commands/ Note: the top-level
/index is bilingual (JA stub atdocs/ claude/ docs-); only the four deep prefixes above are default-locale-only.ja/ claude/ index. mdx docs-is a deliberate JA-only stub with no EN-parity obligation: its EN counterpartja/ claude/ index. mdx docs/is build-generated, so hand-editing the JA file to mirror EN content would be clobbered on the next generate. Keep the JA stub minimal — do not attempt to translate the generated EN index into it.claude/ index. mdx
Frontmatter Fields
Schema in repo-root zfb.config.ts (docsSchema). Required: title (string). Key optional fields:
| Field | Type | Description |
|---|---|---|
sidebar_position | number | Sort order within category (lower = higher). Always set this |
description | string | Subtitle below the title |
sidebar_label | string | Custom sidebar text (overrides title) |
tags | string[] | Cross-category grouping (must exist in src/) |
draft | boolean | Exclude from build entirely |
unlisted | boolean | Built but hidden from sidebar/nav |
generated | boolean | Build-time generated content (skip translation) |
hide_sidebar | boolean | Hide left sidebar |
hide_toc | boolean | Hide right-side TOC |
Content Rules
No h1 in content: The frontmatter
titlerenders as the page h1. Start with## h2.Always set
sidebar_position: Without it, pages sort alphabetically.Kebab-case file names: Use
my-article.mdx, notmyArticle.mdx.
Admonitions
Available in all MDX files without imports (registered globally).
Directive syntax: :::note[Title] ... :::
JSX syntax: <Note>, <Tip>, <Info>, <Warning>, <Danger> — each accepts optional title prop.
Linking Between Docs
Use relative file paths with .mdx extension:
[Link text](./sibling-page.mdx)
[Link text](../other-category/page.mdx#anchor)Navigation Structure
Navigation is filesystem-driven. Directory structure becomes sidebar navigation.
Pages ordered by
sidebar_position(ascending)Category index pages (
index.mdx) control category position viasidebar_position; addsidebar_labelfor a custom sidebar name; addcategory_sort_order: "desc"for newest-first ordering; addcategory_no_page: trueto create a non-linked category header (no route/sitemap/search entry)_category_.jsonstill works but triggers a zfb build warning; preferindex.mdxfrontmatterHeader nav defined in
src/viaconfig/ settings. ts headerNavwithcategoryMatch
Content Creation Workflow
Create English
.mdxfile underdocs/withtitleandsidebar_positionWrite content starting with
## h2headings (not# h1)Create matching Japanese file under
docs-ja/Keep code blocks and
<HtmlPreview>blocks identical — only translate proseRun
pnpm formatthenpnpm buildto verify