facebook / facebook/docusaurus

`undefined` Value for Docs plugin `sidebarPath` Broken on Multi Version

Offen
#7,968 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug status: needs more information
Vorherrschende Sprache
TypeScript
Sterne
66.2k
Forks
10k
Ø Merge
1 T. 3 Std.
Gemergte PRs (30 T.)
52

Beschreibung

### Have you read the Contributing Guidelines on issues?

- [X] I have read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#reporting-new-issues).

### Prerequisites

- [X] I'm using the latest version of Docusaurus.
- [x] I have tried the `npm run clear` or `yarn clear` command.
- [x] I have tried `rm -rf node_modules yarn.lock package-lock.json` and re-installing packages.
- [X] I have tried creating a repro with https://new.docusaurus.io.
- [X] I have read the console error message carefully (if applicable).

### Description

According to https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-docs#sidebarPath if we set `undefined` as a value on `sidebarPath`, we can use fully autogenerated sidebar without using `sidebars.js` file.

On a fresh install, and set `sidebarPath` to `undefined` we can see that sidemenu autogenerated succesfully. However no sidemenu shown when enabling multiversioning.

### Reproducible demo

https://stackblitz.com/edit/github-bcjxsn

### Steps to reproduce

1. Create a new fresh instance of Docusaurus.
2. Open `docusaurus.config.js` set `sidebarPath` to undefined.
3. Delete `sidebars.js`. When you see the site, side menu will fully autogenerated.
4. Enable multiversioning, for example run `docusaurus docs:version 1.1.0` to add a version.
5. Delete `versioned_sidebars` folder, sidebar will not be autogenerated.

### Expected behavior

Setting `undefined` as a value of `sidebarPath` Docs plugin config should be enough to show fully autogenerated side menu without `sidebars.js` even when we enable multiversioning.

### Actual behavior

When multiversioning enabled, no side menu is autogenerated. User should add `versioned_sidebars` manually even if we set `undefined` as a value of `sidebarPath`.

### Your environment

- Docusaurus version used: 2.0.1
- Environment name and version (e.g. Chrome 89, Node.js 16.4):
- Operating system and version: MacOS Monterey 12.5

### Self-service

- [ ] I'd be willing to fix this bug myself.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.