zudo-doc
GitHub repository

Type to search...

to open search from anywhere

Writing Docs

CreatedApr 27, 2026Takeshi Takatsudo

How to create and organize documentation pages in zudo-doc.

Creating a Document

Create an .mdx file in src/content/docs/. Use frontmatter for metadata:

---
title: My Page
description: A brief summary of this page.
sidebar_position: 1
---

Your content here.

Frontmatter Fields

FieldTypeRequiredDescription
titlestringYesPage title (shown in sidebar and header)
descriptionstringNoSubtitle shown below the title
sidebar_positionnumberNoSort order within category (lower = first)
sidebar_labelstringNoOverride sidebar display label

⚠️ Warning

Do not use # h1 headings in your document content. The frontmatter title is automatically rendered as the page title (h1). Starting your content with ## h2 headings instead.

πŸ“ Note

See the Frontmatter guide for the complete reference of all available fields.

Directory Structure

Organize docs into categories using directories:

src/content/docs/
  getting-started/
    introduction.mdx      # sidebar_position: 1
    installation.mdx       # sidebar_position: 2
    writing-docs.mdx       # sidebar_position: 3
  guides/
    configuration.mdx      # sidebar_position: 1
    sidebar.mdx            # sidebar_position: 2

Each directory becomes a collapsible sidebar category automatically. The category name is derived from the directory name (kebab-case converted to Title Case).

Linking Between Documents

You can link to other documents using relative file paths:

[Installation guide](./installation.mdx)
[Frontmatter reference](../guides/frontmatter.mdx)
[Back to index](./index.mdx)

These relative paths are automatically resolved to the correct URLs at build time. The .md/.mdx extension is required for the link resolver to work β€” it distinguishes file links from URL links.

You can also include anchors and query strings:

[Frontmatter fields](../guides/frontmatter.mdx#required-fields)

πŸ’‘ Tip

Relative links are validated during build. If a linked file doesn’t exist, you’ll see a warning in the build output. This helps catch broken links early.

For external links or links to non-document pages, use regular URLs:

[Astro docs](https://docs.astro.build)
[API reference](/api/v1)

Admonitions

zudo-doc supports Docusaurus-style admonitions. They are registered globally β€” no imports needed:

πŸ“ Note

This is a note β€” use it for general information that readers should be aware of.

πŸ’‘ Tip

This is a tip β€” use it for helpful suggestions and best practices.

ℹ️ Info

This is an info block β€” use it for additional context or background information.

⚠️ Warning

This is a warning β€” use it to flag potential issues or things to watch out for.

🚨 Danger

This is a danger alert β€” use it for critical warnings about data loss or breaking changes.

Custom Titles

πŸ“ Custom Title

You can provide a custom title to any admonition using the title prop.

Admonition Syntax

Two syntaxes are supported. No imports needed for either.

Directive syntax (recommended for content authors):

:::note[Optional Title]

Content here.

:::

JSX component syntax:

<Note>
Default note with auto-generated title.
</Note>

<Warning title="Be Careful">
Warning with a custom title.
</Warning>

Each admonition type maps to a palette slot for its border and title color:

TypePalette SlotTypical Color
Notep4Blue
Tipp2Green
Infop6Cyan
Warningp3Yellow
Dangerp1Red

πŸ’‘ Tip

For a complete list of all available components including admonitions, code blocks, and more, see the Components reference.

i18n (Internationalization)

zudo-doc supports English and Japanese out of the box. Japanese docs mirror the English directory structure in src/content/docs-ja/.

πŸ’‘ Tip

See the i18n guide for detailed instructions on managing translations and language routing.

MDX Features

You can use Preact components in your documentation. Interactive components hydrate as Astro islands β€” the rest ships as pure HTML with zero JavaScript.

import MyComponent from "@/components/my-component";

<MyComponent client:load />

ℹ️ Info

Use client:load for components that need interactivity. Omit it for components that only render static HTML.

zudo-doc automatically generates:

  • Sidebar β€” collapsible categories with items sorted by sidebar_position
  • Table of Contents β€” right sidebar with h2–h4 headings (visible on wide screens)
  • Prev/Next links β€” bottom navigation between docs
  • Breadcrumbs β€” category path shown above the title

Revision History

AI Assistant

Ask a question about the documentation.