Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(v2): subcategories #1670

Merged
merged 2 commits into from
Jul 18, 2019
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)._

-->