mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 07:37:19 +02:00
Add ability to specify sub categories in sidebar.json (#891)
This commit is contained in:
parent
dd9d05c84d
commit
16087b4428
14 changed files with 534 additions and 87 deletions
|
@ -94,6 +94,29 @@ You should provide `directory/id` instead of `id` in `sidebars.json`.
|
|||
}
|
||||
```
|
||||
|
||||
### Adding Sub Categories
|
||||
|
||||
It is possibile to add sub categories to a sidebar. Instead of passing an array to the category like the previous examples you can pass an object where
|
||||
the keys will be the sub category name. You can then pass an array of document ids to the sub category.
|
||||
|
||||
```js
|
||||
{
|
||||
"examples-sidebar" : {
|
||||
"My Example Category" : {
|
||||
"My Example Sub Category" : [
|
||||
"my-examples",
|
||||
...
|
||||
],
|
||||
"My Next Sub Category" : [
|
||||
"some-other-examples"
|
||||
]
|
||||
...
|
||||
},
|
||||
...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Adding New Sidebars
|
||||
|
||||
You can also put a document in a new sidebar. In the following example, we are creating an `examples-sidebar` sidebar within `sidebars.json` that has a category called `My Example Category` containing a document with an `id` of `my-examples`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue