Open mosc9575 opened 2 weeks ago
If the switcher says "choose version" it indicates that something went wrong in determining what version of the docs are currently being viewed (and matching that up with a corresponding entry in the switcher JSON array). In other words, it's a "graceful failure mode" so that the intent of the dropdown is still clear. I'd rather not make it possible to have the switcher appear as if it detected the version but have it actually display something (possibly) inaccurate.
Can you check the Javascript console of your browser when your site is loaded, to see if:
I know, that "Choose version"
shows up, if no version match can be found in the switcher.json
. The original post comes from bokeh #13477. In an earlier version, the default wasn't "Choose version"
but the "dev"-version.
At the moment we have to update the switcher.json
for each development version, if we want the old behavior. This is somehow annoying. And after an release the latest dev versions can still be found on the web because they arn't removed, but the switcher.json
will not have an entry for each older dev version. This means, it will display "Choose version"
again.
In this issue I want to set the default by hand, if this is possible.
This is a feature request, to enable the user to overwrite
"Choose version"
with a string the user preferes.In my case I want to show the build version of the docs if no version in the
switcher.json
matches.This was the case before https://github.com/pydata/pydata-sphinx-theme/commit/5db8dff57b0bc5ced11ca7188d6ea636d695e2e8 was commited.
At the moment the relevant code line is this
https://github.com/pydata/pydata-sphinx-theme/blob/09849cc5112ab1e08d703a427459f2570f80a0aa/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/version-switcher.html#L16
and I suggest to change this line to
so the user can define his personal default value in the
conf.py
by addingversion_match_default
to the switcher settings.For example this should be possible.