pydata / pydata-sphinx-theme

A clean, three-column Sphinx theme with Bootstrap for the PyData community
https://pydata-sphinx-theme.readthedocs.io
BSD 3-Clause "New" or "Revised" License
565 stars 304 forks source link

Version switcher button inner text displaying "Choose version" instead of active version #1681

Closed yalap13 closed 5 months ago

yalap13 commented 6 months ago

Hi,

I have tried adding a version switcher dropdown to my documentation page and depite specifying the version_match, the button inner text always remains "Choose version". Am I supposed to add some sort of configuration somewhere so that the currently viewed version is displayed instead?

Here are the related conf.py parts :

release = __version__

...

version_match = os.environ.get("READTHEDOCS_VERSION")
if not version_match or version_match.isdigit() or version_match == "latest":
    if "dev" in release or "rc" in release:
        version_match = "dev"
        json_url = "_static/switcher.json"
    else:
        version_match = release
elif version_match == "stable":
    version_match = release

html_theme_options = {
    ...
    "switcher": {
        "json_url": json_url,
        "version_match": version_match,
    },
    ...
}
cbrnr commented 2 months ago

Apparently, this issue still persists with the current version of the theme. May I ask how you were able to resolve it? Even this project's website currently doesn't show the selected version.

drammock commented 2 months ago

Apparently, this issue still persists with the current version of the theme. May I ask how you were able to resolve it? Even this project's website currently doesn't show the selected version.

The version dropdown on theme's site was working correctly until yesterday, when I pushed a release candidate and apparently did something wrong (or perhaps something in our JS doesn't handle the RC correctly)

cbrnr commented 2 months ago

There's something wrong with the versions, it still shows 0.15.2 as stable, but when I choose dev, it displays the current stable version 0.15.3. There, the version chooser correctly displays the version tag.