Skip to content
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

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

Closed
yalap13 opened this issue Jan 26, 2024 · 3 comments

Comments

@yalap13
Copy link

yalap13 commented Jan 26, 2024

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,
    },
    ...
}
@yalap13 yalap13 closed this as completed Jan 30, 2024
@cbrnr
Copy link

cbrnr commented May 2, 2024

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
Copy link
Collaborator

drammock commented May 2, 2024

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
Copy link

cbrnr commented May 3, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants