Add ability to specify sub categories in sidebar.json (#891)

This commit is contained in:
Will Brock 2018-08-06 21:58:48 -04:00 committed by Yangshun Tay
parent dd9d05c84d
commit 16087b4428
14 changed files with 534 additions and 87 deletions

View file

@ -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`.