Skip to content

fix: count published pages, not index.html files - #22

Merged
toastygm merged 1 commit into
mainfrom
bug/20_tally-counts-published-pages
Sep 4, 2026
Merged

fix: count published pages, not index.html files#22
toastygm merged 1 commit into
mainfrom
bug/20_tally-counts-published-pages

Conversation

@toastygm

@toastygm toastygm commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

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.

Confirmed page inventory — clean origin/main builds of every caller, on
this machine:

package package-build index.html files tally after the fix
kethira 15 homepage-root/index.html (7,419 B, 1,294 visible chars in <main>) + index.html (4,916 B, 0 visible chars in <main>) 1
harnadventures 9 index.html — the landing itself 1
harnensemble 10 index.html — the landing itself 1
hm3 9 index.html — the landing itself 1

content-build site reports wrote 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 driven
against the four real build trees and a set of constructed ones:

tree mode expected result
kethira, as built homepage pass pass — 2 index.html file(s); 1 page(s)
harnadventures / harnensemble / hm3, as built homepage pass pass — 1 page(s)
kethira + a genuinely built second content page at /kethira/deity-agrik/ homepage reject rejected — 2 page(s)
harnadventures (pre-#182 shape) + a second content page homepage reject rejected — 2 page(s)
content tree, new shape, 1,714 pages, min-pages: 1000 content pass pass
content tree collapsed to Hugo's root alone content reject rejected
content tree collapsed to the landing alone content reject rejected
nothing at all homepage reject rejected at the root check

shellcheck is clean on the extracted body and the file parses as YAML.

Effect on callers. All four callers of this workflow are
publish.site: homepage and none passes min-pages/max-pages (homepage mode
rejects them). sohl and sohl-thalorna do not call this workflow — each still
deploys 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 declared
threshold moves anywhere, which is also why discounting in content mode costs
nothing today.

Closes #20

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
@toastygm
toastygm merged commit f9ae7a3 into main Sep 4, 2026
1 check passed
@toastygm
toastygm deleted the bug/20_tally-counts-published-pages branch September 4, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The page-count guard counts index.html files, so an addressed homepage reads as two pages and fails every homepage-only deploy

1 participant