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

Latest version on RTD button goes to 0.15.4 #2035

Open
stevepiercy opened this issue Nov 12, 2024 · 4 comments · May be fixed by #2048
Open

Latest version on RTD button goes to 0.15.4 #2035

stevepiercy opened this issue Nov 12, 2024 · 4 comments · May be fixed by #2048
Labels
kind: bug Something isn't working tag: javascript Pull requests that update Javascript code

Comments

@stevepiercy
Copy link
Contributor

stevepiercy commented Nov 12, 2024

When I visit https://pydata-sphinx-theme.readthedocs.io/en/latest/community/index.html, I see a red banner with the text "This is documentation for an unstable development version." and a button that says "Switch to stable version". When I click it, I go to https://pydata-sphinx-theme.readthedocs.io/en/v0.15.4/community/index.html.

This time I am presented with "This is documentation for an old version (0.15.4)." and the button "Switch to stable version". When I click it, I finally go to https://pydata-sphinx-theme.readthedocs.io/en/stable/community/index.html.

I think the first screen should go to the third directly.

@stevepiercy stevepiercy changed the title Latest version Latest version on RTD button goes to 0.15.4 Nov 12, 2024
@trallard
Copy link
Collaborator

Hi there, I just checked and going to https://pydata-sphinx-theme.readthedocs.io/en/stable/community/index.html# takes me to the stable version.

I believe the behaviour you saw before was due to a miss on the version.json file which was fixed by #2028

I will close this issue as I cannot reproduce this, but if this persists on your end, we can reopen this.

@drammock
Copy link
Collaborator

I can reproduce

@drammock drammock reopened this Nov 15, 2024
@drammock
Copy link
Collaborator

The problem is here:

const origin = await fetch(window.location.origin, { method: "HEAD" });

When using dev docs, the json_url is always a relative path (_static/switcher.json) rather than a full URL. In that case, we use the line above to get the base part of the URL... but even when the page is within .../en/latest/... the value of origin is https://pydata-sphinx-theme.readthedocs.io/en/stable/ (I guess because https://pydata-sphinx-theme.readthedocs.io auto-redirects to stable?)

I think it was an accident that this ever worked, the bug was just not revealed until a release was made.

@trallard trallard added kind: bug Something isn't working tag: javascript Pull requests that update Javascript code labels Nov 18, 2024
@trallard
Copy link
Collaborator

I wonder if this also has something to do with the recent changes to RTD, mainly now using the flyout addons https://blog.readthedocs.com/addons-flyout-menu-beta/ vs. injecting stuff at build time like they used to.

@drammock drammock linked a pull request Nov 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working tag: javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants