Skip to content

Document Management

Create a Document

Add a new document by creating a .md file under the docs/ directory:

bash
# Create a new guide document
touch docs/guide/new-page.md

Write a Document

Write content using Markdown syntax:

markdown
# Page Title

Body content...

## Heading Level 2

### Heading Level 3

Frontmatter

You can add frontmatter metadata at the top of each page:

markdown
---
title: Page title
description: Page description
layout: doc
sidebar: false      # Hide the sidebar
aside: false        # Hide the right-hand outline
---

Document Categories

Categorize documents using the directory structure:

docs/
├── guide/          # User guides
├── api/            # API docs
├── tutorial/       # Tutorials
└── faq.md          # FAQ

Add to the Sidebar

Add the new document to sidebar in config.mts:

ts
sidebar: {
  '/guide/': [
    {
      text: 'Introduction',
      items: [
        { text: 'New Page', link: '/guide/new-page' }
      ]
    }
  ]
}

Document Ordering

The order of documents in the sidebar is determined by the order of the items array in the config.

最近更新