mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-31 07:18:59 +02:00
feat(blog): group sidebar items by year (themeConfig.blog.sidebar.groupByYear
) (#10252)
Co-authored-by: sebastien <lorber.sebastien@gmail.com>
This commit is contained in:
parent
10830ce25c
commit
aab1f4868b
21 changed files with 547 additions and 85 deletions
|
@ -158,6 +158,74 @@ export default {
|
|||
};
|
||||
```
|
||||
|
||||
## Plugins
|
||||
|
||||
Our [main themes](./overview.mdx) offer additional theme configuration options for Docusaurus core content plugins.
|
||||
|
||||
### Docs
|
||||
|
||||
```mdx-code-block
|
||||
<APITable name="navbar-overview">
|
||||
```
|
||||
|
||||
| Name | Type | Default | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `versionPersistence` | `'localStorage' \| 'none'` | `undefined` | Defines the browser persistence of the preferred docs version. |
|
||||
| `sidebar.hideable` | `boolean` | `false` | Show a hide button at the bottom of the sidebar. |
|
||||
| `sidebar.autoCollapseCategories` | `boolean` | `false` | Automatically collapse all sibling categories of the one you navigate to. |
|
||||
|
||||
```mdx-code-block
|
||||
</APITable>
|
||||
```
|
||||
|
||||
Example configuration:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
export default {
|
||||
themeConfig: {
|
||||
docs: {
|
||||
// highlight-start
|
||||
versionPersistence: 'localStorage',
|
||||
sidebar: {
|
||||
hideable: false,
|
||||
autoCollapseCategories: false,
|
||||
},
|
||||
// highlight-end
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### Blog
|
||||
|
||||
```mdx-code-block
|
||||
<APITable name="navbar-overview">
|
||||
```
|
||||
|
||||
| Name | Type | Default | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `sidebar.groupByYear` | `boolean` | `true` | Group sidebar blog posts by years. |
|
||||
|
||||
```mdx-code-block
|
||||
</APITable>
|
||||
```
|
||||
|
||||
Example configuration:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
export default {
|
||||
themeConfig: {
|
||||
blog: {
|
||||
// highlight-start
|
||||
sidebar: {
|
||||
groupByYear: true,
|
||||
},
|
||||
// highlight-end
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
## Navbar {#navbar}
|
||||
|
||||
Accepted fields:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue