Documentation
Documentation
Section titled “Documentation”The documentation site is built with Astro Starlight and lives in the zeromicro/zerodoc repository.
Local Setup
Section titled “Local Setup”git clone https://github.com/zeromicro/zerodoc.gitcd zerodocnpm installnpm run dev# open http://localhost:4321File Structure
Section titled “File Structure”src/content/docs/ # English content (root locale)src/content/docs/zh-cn/ # Chinese contentEach page is a Markdown or MDX file with YAML frontmatter:
---title: Page Titledescription: Short description for SEO and the card grid.sidebar: order: 3---Writing Guidelines
Section titled “Writing Guidelines”- Use second-person (“you”), active voice.
- Code blocks must include a language tag:
go,bash, ```yaml. - Add
titleto code blocks for context: ```go title=“main.go”` - Keep sentences short; use tables for comparisons.
- Every page should include a practical code example.
Adding a New Page
Section titled “Adding a New Page”- Create the file in the appropriate chapter directory.
- Add YAML frontmatter with
title,description, andsidebar.order. - Add a link to the chapter’s
index.md. - Create a matching Chinese translation under
zh-cn/.
Submitting
Section titled “Submitting”Open a PR against the main branch of zeromicro/zerodoc. The deploy preview will be posted as a PR comment automatically.