创建文档
整个文档是通过多个页面构成的:
- a 侧边栏
- 上/下 导航
- 版本控制
新建第一个文档
创建一个markdown文件docs/hello.md
:
docs/hello.md
# Hello
This is my **first Docusaurus document**!
刚刚创建的文档页面就展示在http://localhost:3000/docs/hello
.
配置侧边栏
Docusaurus 可以自动从docs
生成侧边栏.
添加元数据以自定义侧边栏标签和位置:
docs/hello.md
---
sidebar_label: 'Hi!'
sidebar_position: 3
---
# Hello
This is my **first Docusaurus document**!
It is also possible to create your sidebar explicitly in sidebars.js
:
sidebars.js
module.exports = {
tutorialSidebar: [
{
type: 'category',
label: 'Tutorial',
items: ['hello'],
},
],
};