mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-22 13:37:05 +02:00
feat(theme-classic): auto-collapse sibling categories in doc sidebar (#3811)
Co-authored-by: Josh-Cena <sidachen2003@gmail.com>
This commit is contained in:
parent
c9a6c7b6fb
commit
8ce3cee400
10 changed files with 104 additions and 16 deletions
|
@ -913,7 +913,9 @@ module.exports = {
|
|||
|
||||
:::
|
||||
|
||||
## Hideable sidebar {#hideable-sidebar}
|
||||
## Theme configuration
|
||||
|
||||
### Hideable sidebar {#hideable-sidebar}
|
||||
|
||||
By enabling the `themeConfig.hideableSidebar` option, you can make the entire sidebar hideable, allowing users to better focus on the content. This is especially useful when content is consumed on medium-sized screens (e.g. tablets).
|
||||
|
||||
|
@ -927,6 +929,19 @@ module.exports = {
|
|||
};
|
||||
```
|
||||
|
||||
### Auto-collapse sidebar categories
|
||||
|
||||
The `themeConfig.autoCollapseSidebarCategories` option would collapse all sibling categories when expanding one category. This saves the user from having too many categories open and helps them focus on the selected section.
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
module.exports = {
|
||||
themeConfig: {
|
||||
// highlight-next-line
|
||||
autoCollapseSidebarCategories: true,
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
## Using multiple sidebars {#using-multiple-sidebars}
|
||||
|
||||
You can create a sidebar for each **set of Markdown files** that you want to **group together**.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue