跳到主要内容

Docusaurus 简单使用

· 阅读需 2 分钟

文档

侧边栏

默认情况下,Docusaurus 会根据文件夹结构自动生成侧边栏。默认配置位于:sidebars.ts. 自动给侧边栏排序的方法有两种:第一种是给每个文档和文件夹添加一个数字前缀。第二种是在文档的 Front Matter 种添加 sidebar_position 配置。使用自动生成的侧边栏时,文件结构将决定侧边栏结构。可以在 Front Matter 中使用 slug 前置项自定义每个文档的 URL。

博客

侧边栏

使用 blogSidebarTitle 选项更改侧边栏标题文本。设置 blogSidebarCount: 'ALL',则可以将其设置为“所有帖子”,而不是默认的“最近帖子”。

docusaurus.config.ts
blogSidebarTitle: 'All posts',
blogSidebarCount: 'ALL',

如果你在同一天发布了多个帖子,你可以根据一天中的时间对它们进行排序:

---
date: 2021-09-13T10:00
---
Toggle me!

This is the detailed content

console.log("Markdown features including the code block are available");

You can use Markdown here including bold and italic text, and inline link

Nested toggle! Some surprise inside...

😲😲😲😲😲

备注

Some content with Markdown syntax. Check this api.

提示

Some content with Markdown syntax. Check this api.

信息

Some content with Markdown syntax. Check this api.

注意

Some content with Markdown syntax. Check this api.

危险

Some content with Markdown syntax. Check this api.