| English | 中文 |
|---|
A documentation template built with VitePress + Deno.
- Multi-language —
en_usandzh_cnout of the box, easy to add more. - Auto sidebar — Sidebar is generated automatically from directory structure.
- Mermaid diagrams — Built-in support via
vitepress-plugin-mermaid. - Math formulas — KaTeX rendering for inline and block math.
- Local search — Full-text search with i18n support.
# Install Deno: https://deno.com
deno task docs:devFor example, add language ru:
- Create content directory
docs/ru/ - Add a locale entry in
docs/.vitepress/locales.tsusingdefineLocale()
For example, a section called readme:
- Create
docs/en_us/readme/anddocs/zh_cn/readme/ - Put an
index.mdin each with atitle:in frontmatter - Add nav links in
docs/.vitepress/locales.ts
The sidebar is generated automatically — no manual config needed.
The sidebar is built from directory structure. You only need to organize your files — no sidebar config to write.
Each directory directly under the language root (e.g. en_us/guide/) becomes
a sidebar section. Files at the language root (like quickref.md) do not get
sidebar entries.
Files are sorted by number prefix. A file named 01-intro.md comes before
02-setup.md, which comes before appendix.md (no prefix). Number prefixes
are stripped from the displayed title.
Each page's sidebar title comes from the title field in its YAML frontmatter.
If absent, the filename (minus extension and number prefix) is used as a
fallback.
A directory's index.md determines whether the sidebar group is clickable:
- If it has a
titlein frontmatter — the title is used as the group label. - If the body is non-empty (has actual content) — the group entry becomes a clickable link.
- If the body is empty (just frontmatter, no content) — the group is a label-only folder, not clickable.
Subdirectories become collapsible groups. They are automatically promoted to the top level of the sidebar (sibling to their parent), not nested inside. Each subdirectory follows the same rules as above for title, link, and ordering.
| Rule | Behavior |
|---|---|
| What becomes a sidebar | Directories under the language root |
| Order | By number prefix in filename |
| Item title | Frontmatter title, or filename sans prefix |
| Nested groups | Subdirectories appear as top-level collapsible groups |
| Clickable group | index.md has non-empty body |
Edit docs/.vitepress/config.ts:
const BASE = '/your-project'Edit docs/.vitepress/config.ts:
srcDir: 'pages',Then update the base default in docs/.vitepress/utils/sidebar.ts.