fix: count published pages, not index.html files - #22
Merged
Conversation
package-build 15 (HeroicLands/package-build#182) gave a package's landing an address of its own, `/<package>/homepage-<shortcode>/`, and Hugo went on generating a site root at `/<package>/` beside it — chrome around an empty `<main>` that nothing in the toolchain writes and `_redirects` sends visitors past. The guard counts `index.html` files, so that root read as a second page and failed `kethira` on every push from the day it took package-build 15. Discount the package-root `index.html` from the tally, in both modes, so "a page" means one thing in this file. Discount it only when the addressed landing is present beside it, matched as `homepage-*`: three callers still build the pre-#182 shape, where that file IS the landing and subtracting it would tally zero and fail all three at once. Keying on the landing rather than on "more than one file" also keeps the licensing bound intact in both shapes — a homepage-only package that published one real extra page tallies two either way. The separate assertion that the deployment root exists and is non-empty stays; it is a different check, and its comment no longer calls that file the home page. Closes #20
4 tasks
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.
package-build 15 (HeroicLands/package-build#182) gave a package's landing an
address of its own,
/<package>/homepage-<shortcode>/, and Hugo went ongenerating a site root at
/<package>/beside it — chrome around an empty<main>that nothing in the toolchain writes and_redirectssends visitorspast. The guard counts
index.htmlfiles, so that root read as a second pageand failed
kethiraon every push from the day it took package-build 15.Discount the package-root
index.htmlfrom the tally, in both modes, so "apage" means one thing in this file. Discount it only when the addressed landing
is present beside it, matched as
homepage-*: three callers still build thepre-#182 shape, where that file IS the landing and subtracting it would tally
zero and fail all three at once. Keying on the landing rather than on "more than
one file" also keeps the licensing bound intact in both shapes — a homepage-only
package that published one real extra page tallies two either way.
The separate assertion that the deployment root exists and is non-empty stays;
it is a different check, and its comment no longer calls that file the home page.
Confirmed page inventory — clean
origin/mainbuilds of every caller, onthis machine:
index.htmlfileskethirahomepage-root/index.html(7,419 B, 1,294 visible chars in<main>) +index.html(4,916 B, 0 visible chars in<main>)harnadventuresindex.html— the landing itselfharnensembleindex.html— the landing itselfhm3index.html— the landing itselfcontent-build sitereportswrote 1 homepage(s) + 0 content page(s) + 0 tree page(s) + 0 landing(s)for kethira. The content side was never wrong.Verification. The guard's
run:body was extracted verbatim and drivenagainst the four real build trees and a set of constructed ones:
2 index.html file(s); 1 page(s)1 page(s)/kethira/deity-agrik/2 page(s)2 page(s)min-pages: 1000shellcheckis clean on the extracted body and the file parses as YAML.Effect on callers. All four callers of this workflow are
publish.site: homepageand none passesmin-pages/max-pages(homepage moderejects them).
sohlandsohl-thalornado not call this workflow — each stilldeploys from its own hand-written one, and thalorna's floor (
test "$pages" -gt 1000) lives in that file and is untouched by this change. So no declaredthreshold moves anywhere, which is also why discounting in
contentmode costsnothing today.
Closes #20