注意
本文多数取自官方的说明,用于告诉有贡献想法的如何添加或修改页面。
如何创建一个文档
文档是一组页面,通过以下方式组织:
- 侧边栏
- 前后页导航
- 版本管理
创建你的第一个文档
在docs/hello.md
创建一个Markdown文件:
docs/hello.md
# Hello
This is my **first Docusaurus document**!
A new document is now available at http://localhost:3000/docs/hello.
配置侧边栏
Docusaurus会自动生成侧边栏自docs
文件夹。
添加元数据以自定义侧边栏标签和位置:
docs/hello.md
---
sidebar_label: 'Hi!'
sidebar_position: 3
---
# Hello
This is my **first Docusaurus document**!
也可以在sidebars.js
中明确创建侧边栏:
sidebars.js
export default {
tutorialSidebar: [
'intro',
'hello',
{
type: 'category',
label: 'Tutorial',
items: ['tutorial-basics/create-a-document'],
},
],
};