Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 32 additions & 5 deletions website/docs/sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,40 @@ The `docs` key in the exported object is just the name of that particular sideba

## Subcategories

_This section is a work in progress. [Welcoming PRs](https://github.com/facebook/docusaurus/issues/1640)._
To include subcategories in docs sidebar, use an object of the following shape

<!--
```js
{
type: 'category',
label: string, // sidebar label
items: string[], // strings of doc ids
}
```

Note: We're implementing a new sidebar, this following links to the legacy sidebar as a reference
[source code](packages/docusaurus-theme-classic/src/theme/DocLegacySidebar/index.js)
in place of a string of id. As an example, here's how we created the subcategory for "Docs" under "Guides" in this site:

If you are interested in this section, please follow up on our progress
```jsx
// sidebars.js
module.exports = {
docs: {
Guides: [
'creating-pages',
{
type: 'category',
label: 'Docs',
items: ['markdown-features', 'sidebar'],
},
],
},
};
```

**Note**: Only one layer of nestedness is allowed.

**Note**: We're implementing a new sidebar!

<!--

_This section is a work in progress. [Welcoming PRs](https://github.com/facebook/docusaurus/issues/1640)._

-->