Skip to content

Modify versions menu to keep you on the same page #628

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

Merged
merged 20 commits into from
Jul 8, 2023

Conversation

steff456
Copy link
Member

@steff456 steff456 commented May 9, 2023

This PR fixes #620

  • Modify function of sphinx-material to remain in the same page if the version is changed.

Extra info

I realized that we cannot guarantee that there will be a page available with the same path in the rest of versions. For example, if the function was added/removed/renamed in a later version.

If the page doesn't exist we will have an error that looks like this,

image

My fix was to add a head request before assigning the href to just verify if it is working, if it doesn't exist then it will redirect to the other version's homepage.

@steff456 steff456 added the Maintenance Bug fix, typo fix, or general maintenance. label May 9, 2023
@steff456 steff456 self-assigned this May 9, 2023
@steff456 steff456 marked this pull request as draft May 10, 2023 00:35
@steff456 steff456 marked this pull request as ready for review July 3, 2023 17:27
@steff456 steff456 requested review from rgommers and kgryte July 3, 2023 17:28
@steff456 steff456 added this to the v2023 milestone Jul 3, 2023
@rgommers
Copy link
Member

rgommers commented Jul 4, 2023

Thanks @steff456, this seems to work now from some testing in the build preview. Since this is all JS code, I'll defer to @kgryte for the rest.

@kgryte
Copy link
Contributor

kgryte commented Jul 8, 2023

Thanks, @steff456! Let's merge this in, and we can address any encountered issues in follow-up PRs.

@kgryte kgryte merged commit 8c5ba34 into data-apis:main Jul 8, 2023
@kgryte kgryte deleted the feat-version-dropdown branch July 8, 2023 22:12
This was referenced Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Bug fix, typo fix, or general maintenance.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Versions menu doesn't keep you on the same page
3 participants