feat(v2): add custom props for consumption by swizzled sidebar (#3888)

This commit is contained in:
Oliver Ullman 2020-12-10 11:49:21 -07:00 committed by GitHub
parent 0b05806593
commit b11c24b752
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 41 additions and 11 deletions

View file

@ -288,6 +288,20 @@ module.exports = {
};
```
#### Custom Props
If you would like to pass in custom props to a swizzled sidebar item, an optional object called `customProps` can be added to any of the items:
```js
{
type: 'doc';
id: 'doc1';
customProps: {
/* props */
}
}
```
#### Collapsible categories
For sites with a sizable amount of content, we support the option to expand/collapse a category to toggle the display of its contents. Categories are collapsible by default. If you want them to be always expanded, set `themeConfig.sidebarCollapsible` to `false`: