Eliminate the Hugo taxonomy layout warning by disabling unused page kinds #13
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Every build of this site emits:
Reproduce with
make testorscript/cibuild.Hugo enables the
tagsandcategoriestaxonomies by default. This site is asingle page with no taxonomy terms and no taxonomy templates, so Hugo generates
taxonomy list pages it has no layout for and warns on each build.
Two reasons to fix it rather than live with it:
next warning — a real one, about a broken link or a template error that has
not yet become fatal — will scroll past unnoticed. #9 is about to route
script/lintinto the gate, which adds--printPathWarningsoutput to thesame stream; the noise floor should be zero before that lands.
Fix
Disable the unused kinds in
hugo.toml:This is the documented Hugo mechanism for a site that uses no taxonomies. It
removes the warning at its source rather than suppressing it.
Definition of done
hugo.tomldisables thetaxonomyandtermkinds.make testandmake lintboth produce zeroWARNlines. Paste thefull build output into the PR to demonstrate it.
public/before and after and confirmindex.htmlandcss/style.cssare byte-identical. Only the (unused,unlinked) taxonomy pages should disappear from
public/.sitemap.xmlstill contains the home page and no longerreferences taxonomy URLs. Confirm the sitemap is still generated at all — if
disabling these kinds also drops the sitemap, revert and use a narrower fix.
make checkpasses andscript/cibuildsucceeds.TODO.mdupdated in the same commit.Explicitly out of scope
--panicOnWarningor otherwise make warnings fatal. That is aseparate policy decision about how strict the gate should be, and it would
need to be made deliberately rather than as a side effect of this cleanup.
dead files to silence a warning about pages the site does not want.
Relationship to other issues
Independent of #9, but they touch the same build output. Whichever lands
second should re-verify the combined output is clean.
Implementation plan
First, re-verified the premise against current
main(9e3f955), since thebuild now runs the pinned, hash-verified hugo
v0.164.0fromscript/bootstraprather than the apk 0.139.0 that was current when this issue was written. The
warning is unchanged on
v0.164.0:and the generated sitemap still lists the two unwanted taxonomy URLs alongside
the home page:
So the issue is current and
disableKindsis still the documented mechanism onthis version.
Change
One line in
hugo.toml:Nothing else. No taxonomy templates, no
--panicOnWarning, no changes toscript/bootstrapor.gitea/workflows/deploy.yml— the live deploy path isuntouched by this.
Verification
public/built before and after;index.htmlandcss/style.csscomparedbyte-for-byte, and the full file list diffed so the only deltas are the
disappearing
categories/index.xmlandtags/index.xml.sitemap.xmlconfirmed still generated, still containing the home page, andno longer containing any taxonomy URL. If it vanishes, revert and use a
narrower fix rather than shipping a sitemap-less site.
make testandmake lintoutput scanned for any remainingWARNline;target is zero.
make checkgreen, thenscript/cibuild, with themake checklayerconfirmed to have genuinely executed rather than being served from cache
(#23 is still open, so exit 0 alone is not evidence). Cache invalidation
will be scoped to this build only — no builder prune, since this is a
shared host.
TODO.mdupdated in the same commit.Implemented in #29 (commit
70048b3).hugo.tomlgainsdisableKinds = ['taxonomy', 'term']with a commentexplaining why;
TODO.mdupdated in the same commit. No taxonomy templatesadded, no
--panicOnWarning, nothing else touched.Against the definition of done:
make test,make lintand the fullmake checkall emit zeroWARNlines. The build output is now just the hugo banner and the page count
table.
public/diffed before and after withdiff -r.index.html,css/style.cssand the RSSindex.xmlare byte-identical. The onlydeltas are the intended ones:
categories/index.xmlandtags/index.xmlare gone, and
sitemap.xmlis trimmed.sitemap.xmlis still generated and still contains the home page — therevert condition does not trigger. It went from
https://lora.vegas/categories/,https://lora.vegas/,https://lora.vegas/tags/down to justhttps://lora.vegas/.make checkpasses.script/cibuildsucceeds, and theRUN make checklayer was confirmed to have genuinely executed rather than being served
from cache: with plain progress output it reported
DONE 4.6swith itsfull build output present, not
CACHED, on the container's own pinnedhugo v0.164.0. No builder prune was used.
Worth recording for whoever picks up
#25: with this merged the noise
floor is actually zero, so making warnings fatal is now a viable decision
rather than one that would immediately fail the build.
script/bootstrapand.gitea/workflows/deploy.ymlare untouched, so the livedeploy path is unaffected. Not verified: an actual Cloudflare Pages deploy,
which only happens on merge to
main.