-
Notifications
You must be signed in to change notification settings - Fork 250
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
Out of order language tabs #546
Comments
🎉 Thanks for opening your first issue here! Welcome to the community! |
Hi @Gijsdeman, thanks for reporting. The |
Actually, it seems that it's only "required" once the default order is changed. This smells more like a bug. We'll investigate a bit more and will keep you updated. |
Same here with Docusaurus languageTabs: [
{
highlight: "bash",
language: "curl",
logoClass: "bash",
variant: "cURL",
},
{
highlight: "go",
language: "go",
logoClass: "go",
variant: "native",
},
{
highlight: "javascript",
language: "nodejs",
logoClass: "nodejs",
variant: "axios",
},
], With the |
I also just ran into this. Some potentially helpful information: Potential source of the bugThe crash message includes the "Available values" of variants for the current I see that there's some config merging going on in that component. I suspect that the merging is resulting in most properties taking on the customized sequence of A workaroundOn a whim, I tried defining the So I guess if the tabs are reordered, both the As an example, this configuration for the previous comment functions correctly for me, with Docusaurus v languageTabs: [
{
highlight: "bash",
language: "curl",
logoClass: "bash",
variant: "cURL",
},
{
highlight: "go",
language: "go",
logoClass: "go",
variant: "native",
variants: ["native"],
},
{
highlight: "javascript",
language: "nodejs",
logoClass: "nodejs",
variant: "axios",
variants: ["native", "axios", "request", "unirest"],
},
], |
also noticed that if I want to remove a variant / reorder a variant - it doesn't appear to work. for instance, I just wanted to show |
adding to roadmap with the goal of expanding support for more languages and allow flexible ordering/inclusion |
Addressed in #862 |
Describe the bug
When using the language tabs are configured in a different order than shown in customization, the tabs seem to no longer switch properly between languages anymore.
Expected behavior
The language to update when switching between language tabs.
Current behavior
Language gets stuck on a language and does not load the language of the currently selected tab.
Steps to reproduce
Adding the following
languageTabs
to thethemeConfig
will cause the language to render as intended.languageTabs: [ { highlight: "bash", language: "curl", logoClass: "bash", }, { highlight: "python", language: "python", logoClass: "python", variant: "requests", }, { highlight: "go", language: "go", logoClass: "go", }, { highlight: "javascript", language: "nodejs", logoClass: "nodejs", variant: "axios", }, { highlight: "php", language: "php", logoClass: "php", } ],
However, when changing the position of PHP language (or any other language), causes the tabs to no longer function properly.
languageTabs: [ { highlight: "bash", language: "curl", logoClass: "bash", }, { highlight: "php", language: "php", logoClass: "php", }, { highlight: "python", language: "python", logoClass: "python", variant: "requests", }, { highlight: "go", language: "go", logoClass: "go", }, { highlight: "javascript", language: "nodejs", logoClass: "nodejs", variant: "axios", } ],
Screenshots
Context
PHP or shell has preference within the wanted documentation, so I prefer to have it as the first two options available. This is not a huge issue in general, but would be nice to be able to do this.
Your Environment
Version used:
The text was updated successfully, but these errors were encountered: