Skip to content

WEB: Fix version switcher #48594

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

Closed
wants to merge 1 commit into from
Closed

WEB: Fix version switcher #48594

wants to merge 1 commit into from

Conversation

phofl
Copy link
Member

@phofl phofl commented Sep 16, 2022

The other prs broke the version switcher. It is looking into our html static path, not the website as root path, hence it can not finde the versions.json. We have to give the full link here. Same issue as the logo

@phofl phofl added Web pandas website Docs labels Sep 16, 2022
@phofl phofl added this to the 1.5 milestone Sep 16, 2022
@datapythonista
Copy link
Member

I see. It seems like an obvious bug in the switcher code, we're providing the right urls, and for whatever reason it's dropping half of it (feels like it's taking only the last component of the url). For what I see, this doesn't happen in the latest version of the docs, where I think everything works as expected. So, I assume there was a bug that has been fixed.

If your changes here fix the problem, happy to get this merged. I can't really tell why the changes here prevent the bug. Seems like the changes here only affect the current docs, and the old docs (the broken ones) will still look for the json_url used in them when they were built.

Not sure if you already tried the changes here, but if you didn't, I think the path to versions.json can still be relative, but the url values in versions.json may not to be absolute to work in older versions of pydata-sphinx-theme.

@phofl
Copy link
Member Author

phofl commented Sep 17, 2022

Haven't really got the version switcher to work locally. So if you think this is something else, then we should not merge this.

I read the docs specifically about this and they say that its in the static path

https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/version-dropdown.html#configure-switcher-json-url

The alternative sounded to me as you would have to provide the complete url, but not sure.

@datapythonista
Copy link
Member

True, I didn't realize that it's very difficult to test this before merging, as it only affects old docs.

I don't think this will work. Changes to conf.py will only affect the last version of the documentation, which is working fine. I think the change needs to be in the versions.json, which is what the old versions of the docs fetch, and the only reasonable thing we can change in the old docs. I opened #48600 which I think should fix the problem.

@phofl
Copy link
Member Author

phofl commented Sep 17, 2022

Ah got it, thx. This makes sense to me.

closing this one

@phofl phofl closed this Sep 17, 2022
@phofl phofl deleted the web_fix branch April 27, 2023 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Web pandas website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants