mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-04 01:09:20 +02:00
feat(theme): add versions
attribute to docsVersionDropdown
navbar item (#10852)
Co-authored-by: sebastien <lorber.sebastien@gmail.com>
This commit is contained in:
parent
8bc3e8a092
commit
4d7a28963a
6 changed files with 276 additions and 10 deletions
|
@ -597,11 +597,23 @@ Accepted fields:
|
|||
| `dropdownItemsAfter` | <code>[LinkLikeItem](#navbar-dropdown)[]</code> | `[]` | Add additional dropdown items at the end of the dropdown. |
|
||||
| `docsPluginId` | `string` | `'default'` | The ID of the docs plugin that the doc versioning belongs to. |
|
||||
| `dropdownActiveClassDisabled` | `boolean` | `false` | Do not add the link active class when browsing docs. |
|
||||
| `versions` | `DropdownVersions` | `undefined` | Specify a custom list of versions to include in the dropdown. See [the versioning guide](../../guides/docs/versioning.mdx#docsVersionDropdown) for details. |
|
||||
|
||||
```mdx-code-block
|
||||
</APITable>
|
||||
```
|
||||
|
||||
Types:
|
||||
|
||||
```ts
|
||||
type DropdownVersion = {
|
||||
/** Allows you to provide a custom display label for each version. */
|
||||
label?: string;
|
||||
};
|
||||
|
||||
type DropdownVersions = string[] | {[versionName: string]: DropdownVersion};
|
||||
```
|
||||
|
||||
Example configuration:
|
||||
|
||||
```js title="docusaurus.config.js"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue