Point the docs site root at latest until a release exists - #45
Merged
Conversation
Deploying from main published /latest/ and /main/ but left the gh-pages root without an index.html, so the site root 404'd. `mike set-default` writes that redirect, and it only ran on a release tag -- which a freshly seeded project does not have. Every project created from this template would therefore 404 at its own documentation URL until it cut its first release. The main deploy now sets the default to `latest` when no `stable` version exists yet. Once a release tag ships, the release step repoints the root at `stable` and this step leaves it alone. Verified against a live gh-pages branch: `mike list` prints "main [latest]" before a release and additionally "0.1 [stable]" after, so the guard skips correctly in the second case.
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.
Deploying from
mainpublished/latest/and/main/, but left thegh-pagesroot without anindex.html, so the site root returned 404.mike set-defaultwrites that root redirect, and I had only wired it to therelease-tag step. A freshly seeded project has no tags, so every project
created from this template would 404 at its own documentation URL until it cut
a first release.
Fix
The
maindeploy now sets the default alias tolatestwhen nostableversion exists. Once a release tag ships, the release step repoints the root at
stable, and this guard leaves it alone.Verified against the live
gh-pagesbranch —mike listprints:main [latest]before any release → guard does not match → sets defaultmain [latest]+0.1 [stable]after → guard matches → skipsdocs/index.mdnow states the root's behaviour so downstream users know whatto expect.
The live site was unblocked out-of-band by running
mike set-default latestagainst
gh-pages; this change makes that automatic for anyone seeding thetemplate.