build documentation files and sidebar structure file for Docusaurus-powered sites
-
Create project folder and
cd
.mkdir my-project cd my-project
-
Create Docusaurus site in
website
foldernpx create-docusaurus@latest website classic
-
Create documentation outline file:
my-project.outline.yml
sidebars: - tutorialSidebar: autobrief: true items: - Overview: headings: - Features - "What's new" - Our customers: - Customer C - Customer A - Customer B - Getting started: - Installation - Usage - Quick demo
-
Build documentation skeleton with
create-docusaurus-skeleton
npx create-docusaurus-skeleton my-project.outline.yml -d ./website/docs -s ./website/sidebars.js --verbose
-
Run Docusaurus development server and open the browser at https://localhost:3000
cd website npm start
let sidebars = {
"tutorialSidebar": [
"overview",
"installation",
"usage",
"quick-demo"
]
}
module.exports = sidebars;
-
website/docs/overview.md
--- sidebar_label: Overview --- # Overview Randomly generated text appears here... ## Features Randomly generated text appears here... ## What's new Randomly generated text appears here... ## Our customers Randomly generated text appears here... ### Company C Randomly generated text appears here... ### Company A Randomly generated text appears here... ### Company B Randomly generated text appears here...
-
website/docs/installation.md
--- sidebar_label: Installation --- # Installation Randomly generated text appears here...
-
website/docs/usage.md
--- sidebar_label: Usage --- # Usage Randomly generated text appears here...
-
website/docs/quick-demo.md
--- sidebar_label: Quick demo --- # Quick demo Randomly generated text appears here...
Name | Type | Description | Default |
---|---|---|---|
sidebar | Array<string|object> | Array of sidebar definitions | |
label | string | Text to show in sidebar | |
path | string | path where topic is generated. The path is relative to parent item's path. The top default parent path is docs |
|
id | string | topic basename | slugified value of label |
slug | string | path to associate to item | |
headings | Array<string|object> | Headings to include on topic page | |
order | Object: {by: (label|id); direction?: (asc|desc)} | Indicates how items of a category or headings in a topic are ordered. | When by is specified, direction is asc by default |
items | Array<string|object> | List of items in a category or sub-headings of heading | |
frozen | |||
hidden | boolean | false | |
autofolder | boolean | false | |
autoindex | boolean | false | |
autobrief | boolean | false | |
index | |||
brief | string | ||
title | string | value of label |
skeleton.outline.yml
has the documentation outline.- Run
npm run build-doc