-
Notifications
You must be signed in to change notification settings - Fork 326
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
Name in the version switcher dropdown button (not expanded) #1500
Comments
Normally this text should be changed according to the names set up in the switcher.json file. It was working just fine but since a month we are facing JS issues from our side as well: #1416. Unfortunately we have a hard time understanding what the problem is as we don't see the issue in PR build, preventing us from testing it. |
Thank you for the quick response! Happy to wait 👍 |
Hi @AlenkaF, @12rambau: It looks like the issue has to do with this bit of logic: https://github.com/pydata/pydata-sphinx-theme/blob/main/src/pydata_sphinx_theme/assets/scripts/pydata-sphinx-theme.js#L375-L376. And it interacts with whatever ultimately gets set in the Locally, I was able to fix the Arrow dev docs by setting I'm not totally sure what the change might be for this repo but I thought I'd share the above since I was able to reproduce the issue and fix it locally. |
Thank you @amoeba for the help! You are correct. The version supplied to the In Arrow case the versions do not match ( I have a PR open to test this. If it works, this issue can be closed. |
@amoeba @AlenkaF see what we do in our own docs: pydata-sphinx-theme/docs/conf.py Lines 100 to 109 in 185a37a
so yeah, generally speaking you may need to do a bit of gymnastics in your |
But so this gymnastics is currently also wrong for pydata-sphinx-theme, which is the reason that our stable docs here (https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html) have the same issue: The above quoted logic turns the version match into "stable" or "latest" on read the docs, but our json file doesn't have those entries as "version" key: pydata-sphinx-theme/docs/_static/switcher.json Lines 1 to 11 in 185a37a
So for "latest" version, we change that to "dev" in conf.py so that matches, but for the "stable" version, that doesn't match "v0.14.1" in the json file. |
I don't know if we can change the versions.json to use "stable" instead (I think at some point in the past, this "version" key was used differently, and if we want to keep the version switcher working for older versions, this might need to stay the same?). |
Thank you @jorisvandenbossche for connecting the dots for me... since I don't use RTD to host any of my own projects, and don't have admin access to RTD account for this theme, I never realized that RTD is setting "stable" as the
I think this is the right way forward, I'll open a PR. |
fixed by #1512 (for our docs anyway). For downstream user's docs, they'll still need to maybe do some things in |
In Arrow dev branch we are using the latest version of the theme and we are fine tuning our settings before the new release in the coming week or two. I am struggling to find where to customize the name of the (not expanded) version switcher dropdown button and would be grateful to get your feedback if this is expected behaviour or I am missing something in our settings.
When I load the development version of the Arrow docs the text for the version switcher dropdown button shows "Choose version" but would like to change that to show which version I currently have open. In this case it should show "14.0 (dev)" which is the
"name"
item in the https://github.com/apache/arrow/blob/main/docs/source/_static/versions.json.I see that the text is set in the version switcher component
pydata-sphinx-theme/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/version-switcher.html
Line 7 in 185a37a
but I can't find where it is changed later by javascript so I can take use of it.
The text was updated successfully, but these errors were encountered: