facebook / facebook/docusaurus
Allow setting label for Versions Dropdown
- 主要言語
- TypeScript
- スター
- 66.2k
- フォーク
- 10k
- 平均マージ
- 1日 3時間
- マージ済み PR(30日)
- 52
説明
## 🐛 Bug Report
### 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
(A clear and concise description of what the bug is.)
### Have you read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#reporting-new-issues)?
Yup
## Steps to reproduce
Use https://new.docusaurus.io to create a CodeSandbox reproducible demo of the bug.
Versioning crashes CodeSandbox right now. Please use the example repo.
(Write your steps here:)
1. Create a project with multi-instance docs. Each set of documentation must be versioned. [Documentation is available here.](https://docusaurus.io/docs/docs-multi-instance)
1. Add a `docsVersionDropdown` navbar item for each set of docs as [shown here](https://docusaurus.io/docs/docs-multi-instance#docs-navbar-items)
1. Resize window to collapse navbar to sidebar
## Expected behavior
I expected the current version label to be moved to the sidebar.
(Write what you thought would happen.)
## Actual behavior
The word 'Version' replaces the label for the current (or any) version. In projects with multiple docs this creates a really confusing user experience for anyone using the site on mobile.

[It turns out this value is hard coded in the classic theme.](https://github.com/facebook/docusaurus/blob/072a5a7e2edd59d93aa58cd6fb3a551a7c5d1df4/packages/docusaurus-theme-classic/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx#L70)

It would be great if I could override that label.
## Your environment
- Public source code: N/A
- Public site URL: N/A
- Docusaurus version used: 2.0.0-beta 4
- Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0): Chrome Version 92.0.4515.131, Node.js v15.5.1
- Operating system and version (e.g. Ubuntu 20.04.2 LTS): MacOSX BigSur 11.4
## Reproducible demo
https://github.com/freef/docusaurus-error-example
コントリビューションガイド
評価
この issue はまだ評価されていません。