facebook / facebook/docusaurus

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

Đang mở
#7,968 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug status: needs more information
Ngôn ngữ chính
TypeScript
Star
66.2k
Fork
10k
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
52

Mô tả

### 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.