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

address Read the Docs changes #117

Merged
merged 2 commits into from
Oct 15, 2024
Merged

address Read the Docs changes #117

merged 2 commits into from
Oct 15, 2024

Conversation

davidism
Copy link
Member

Read the Docs no longer injects extra information into conf.py during build.

The base canonical URL is available in the READTHEDOCS_CANONICAL_URL env var.

The versions are only available through the API. I was already planning to redo our version banners, because they're not convenient right now. It currently requires a new build of each old version when a new version is released, which is not practical. (For example, all old versions will no longer build due to the RtD changes.)

@davidism
Copy link
Member Author

RtD docs aren't super clear about what format the canonical URL is in the env var. I added some print statements for the last build, and got:

READTHEDOCS_CANONICAL_URL=https://pallets-sphinx-themes--117.org.readthedocs.build/en/117/

I think the only way to get a link to whatever the current docs currently are, for example "/en/3.0.x/..." but later "/en/3.1.x/..." is to use the /page/... redirect URL as the canonical URL.

Read the Docs no longer injects this information during the build. It
also required a new build of each old version whenever a new version was
released, which is not practical. Instead, use JavaScript to determine
the banner when viewed. Query PyPI for the list of versions, and compare
the docs version. Use CSS for scroll offset.
@davidism davidism marked this pull request as ready for review October 15, 2024 18:45
@davidism davidism merged commit a8338e5 into main Oct 15, 2024
2 checks passed
@davidism davidism deleted the docs-rtd-changes branch October 15, 2024 18:45
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant