Conversation
The version switcher marked a synthetic `{"version": "stable"}` entry as
preferred. pydata-sphinx-theme gates the warning banner on
const i = t(o) && t(s); // t = /^[v\d]/ + semver regex
if (i && n(o, s, "=")) return; // suppress banner
where `s` is the preferred entry's version. `t("stable")` is false, so the
suppression branch was unreachable and every page rendered
"This is documentation for version 0.5.0. [Switch to stable version]" —
including /stable/ itself, whose button linked back to the current page.
Drop the pseudo-version entry: the newest release is now the preferred one
and is served from the /stable/ alias, named "0.5.0 (stable)". Older
releases keep their own versioned URL, so they correctly report "an old
version (X.Y.Z)" instead of a bare "version X.Y.Z".
Also in the release workflow:
- Read switcher.json from the gh-pages worktree instead of curl-ing the
published site, which is served through a CDN cache and could hand the
build a stale copy.
- Only copy to stable/ when the tag is the newest release, so a backport
tag cannot demote a newer one.
- Add a workflow_dispatch job that rebuilds switcher.json from the version
folders present on gh-pages, to fix the live site without cutting a
release. The folder list is used rather than git tags because tags
predating the versioned docs have no folder to link to.
Closes #141
fix(docs): stop the version banner showing on the stable docs
Member
Author
|
Actually, I will close this and open a cleaner version of this without the merge commit by cherry-picking the one relevant commit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.