Skip to content

Doc: Persist current page when switching versions#13497

Merged
rouault merged 1 commit intoOSGeo:masterfrom
geographika:docs-switcher-update
Dec 1, 2025
Merged

Doc: Persist current page when switching versions#13497
rouault merged 1 commit intoOSGeo:masterfrom
geographika:docs-switcher-update

Conversation

@geographika
Copy link
Collaborator

Follow-up to #13480 based on comment at #11812 (comment)

Update renderVersions function to persist current page when selecting versions at the bottom of the TOC.
Tested on https://geographika-gdal.readthedocs.io/ (it can only be tested on a RTD deployment, not locally).

520500463-5843ad6e-3e5e-4725-8178-e113292e829a

I've also opened a PR upstream with these changes: readthedocs/sphinx_rtd_theme#1663

cc @dbaston

@rouault
Copy link
Member

rouault commented Dec 1, 2025

Neat.

What happens if the sub-page doesn't exist in the branch we switch to ? 404 error ? Is there a way to avoid that and just go to the root page of the new branch ?

@dbaston
Copy link
Member

dbaston commented Dec 1, 2025

What happens if the sub-page doesn't exist in the branch we switch to ? 404 error ?

I get a 404, which isn't terrible.

Is there a way to avoid that and just go to the root page of the new branch ?

I guess we'd need to add some redirects.

@rouault rouault added backport release/3.12 Backport to 3.12 branch documentation Issues and contributions to the documentation content labels Dec 1, 2025
@rouault rouault merged commit 7ac474b into OSGeo:master Dec 1, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport release/3.12 Backport to 3.12 branch documentation Issues and contributions to the documentation content

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants