-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow setting label for Versions Dropdown #5415
Comments
Agree this is not good for versioned multi-instances! What behavior would you like this to have? If really needed, what kind of elegant API should we add to enable customizing this label? |
Hmmm... I think that the simplest solution would be to add a field called something like
|
It doesn't make much sense to me to display two version dropdowns simultaneously anyways. In the end it's better if we can display dropdowns dynamically based on the active doc instance, but again—SSR is difficult |
Agreed. My ideal solution would be a version selector in the sidebar (instead of the navbar). Though that gets into feature request territory. I imagine I'd still be annoyed with not being able to rename the version label on the mobile layout even in a single-doc project with a more conventional use of the version dropdown. |
@Josh-Cena if you maintain ios/android sdks, it can make sense on the homepage (where you are not browsing any of those sdks yet). For sure it doesn't scale to a lot of docs plugin instances, but 2 should be fine and make sense to me.
@freef that's an interesting feature we could add. However we should take into consideration that a docs plugin instance may have multiple sidebars. Should all sidebars display that dropdown if the option is enabled? It doesn't make sense to me to configure this on a per-sidebar basis.
Agree, we should add an option. Is |
@slorber when it comes to adding this to a sidebar, I think it makes the most sense to create a new item type. That way it could be something added to a sidebar like any other item and the users can figure out which sidebar it belongs in. Like:
I also don't have a better name than |
Quite similar issue to consider @freef #7409 Note some sites are already using sidebar version dropdowns today: https://apisix.apache.org/docs/apisix/getting-started This currently requires swizzling the sidebar and a bit of React knowledge to make it work: https://github.com/apache/apisix-website/blob/master/website/src/theme/DocSidebar/index.tsx#L64 Would you still need to use a |
Is there any progress on this or the possibility of having a non-swizzed doc sidebar version selector? We've just started to version some of our docs and the feedback we have so far is that the UX is not ideal:
I wonder whether the proposal that @slorber mentions to have it in the sidebar would resolve these issues and make it clearer, but I'm hesitant to swizzle this when it feels like it should be a core feature. |
@andrewnicols if would help if you could share what's the target experience you aim for instead of what's not working at the moment. Do you know existing sites implementing exactly the UX you want?
That doesn't seem like a bad default behavior and is consistent with all the other dropdowns we have.
In which case? Who reported what problem exactly?
If your docs is unversioned, why would you use this version dropdown anyway 🤷♂️ you shouldn't use it.
The core feature of Docusaurus is to be flexible and to allow you to bend it to your custom needs If the version dropdown item doesn't work for you, it's possible to add your own custom navbar items: #7227 We could make it a select instead (ie the navbar element is a button instead of a link) but that would be a different navbar item type with a different ux and configuration, and things to take care of like accessibility. Some users already do this: https://docs.dyte.io/react-native (open-source site) |
🐛 Bug Report
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
(A clear and concise description of what the bug is.)
Have you read the Contributing Guidelines on 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:)
docsVersionDropdown
navbar item for each set of docs as shown hereExpected 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.
It would be great if I could override that label.
Your environment
Reproducible demo
https://github.com/freef/docusaurus-error-example
The text was updated successfully, but these errors were encountered: