Convention

TOC

Directory Structure

The left sidebar is automatically generated based on the file directory structure, where the index file in the first-level directory acts as the document's homepage and will display as the first item in the left navigation. Subfolders can use index.md or index.mdx and define the first-level title to set the grouping title for the left sidebar. Other sub-documents will be automatically merged into the current group, and nested subfolders will follow the same rules.

├── index.md
├── start.mdx
└── usage
    ├── index.mdx
    └── convention.md

We also agree that:

  1. The public directory is used to store static resources such as images, videos, etc.
  2. The public/_remotes directory is used to store static resources associated with remote reference documents. Please do not directly rely on resources from this directory; you may add */public/_remotes to .gitignore to prevent these from being committed to the code repository.
  3. The shared directory is for storing common components, reusable documents, etc., and will not automatically generate document data.

Metadata

At the beginning of the document, you can define the document's metadata such as title, description, author, category, etc., through the frontmatter.

---
title: Title
description: Description
author: Author
category: Category
---

In the body of the document, when using .mdx files, you can access these metadata through frontmatter as described in MDX.

Sorting

Other documents, except for index.md or index.mdx, will be sorted by default according to their file names. You can customize the weight value in the frontmatter to adjust the order of documents in the left sidebar (the smaller the weight value, the higher the priority in sorting).

---
weight: 1
---
WARNING

Note: Currently, changes to the left navigation configuration require a service restart to take effect, and it is usually not necessary to pay too much attention during development.

Preview

Sometimes, we do not need to display special content on the group homepage. In this case, you can use index.mdx file and the Overview component to display the list of documents in the current group. This will showcase the titles, descriptions, and secondary title information of the grouped list file.

# Usage

<Overview />

You can refer to Usage for the effect.