Repository navigation
fix: unbreak the build (/404), and noindex tags only - #34
Merged
Merged
Conversation
PR #33 added a `.Paginator` test to hooks/head-end.html. That partial is rendered from the <head> in the theme's baseof.html, and .Paginator raises "pagination not supported for this page" on any page kind that cannot paginate. /404 is such a kind, so the whole build fails. Reproduced locally with hugo 0.163.3 extended, same error as CI. A kind-guard around the call (home/section/taxonomy/term) makes the build pass but is worse, because head-end runs BEFORE the "main" block, so touching .Paginator initialises pagination before the theme's archive.html calls `.Paginate $pages` with its own page set. Measured on this site: paginator pages, no .Paginator in head : 101 en / 29 lt paginator pages, kind-guarded .Paginator: 135 en / 32 lt The 34 extra pages are the home paginator switching from mainSections (3 pager pages) to all RegularPages (30 pager pages), plus spurious /page/1/ duplicates on non-paginating templates such as snippets/section.html and every snippets subsection. So the paginator clause is removed rather than guarded. The taxonomy and term clause is kept and is unaffected, and it already covers nearly all paginated pages on its own: /tags/page/7/ and /tags/fpv/page/3/ are re-renders of the same Page, so .Kind stays "taxonomy"/"term" on every pager page. Measured 122 of 128 paginated URLs are taxonomy or term. The 6 that remain (home page/2, page/3, lt page/2, fpv/page/2, lt/fpv/page/2) are left indexable deliberately. Hugo 0.163 exposes no read-only pager accessor and .Permalink does not vary between pager renders, so they cannot be detected in the head without the side effect above. A comment in the partial records this so the test is not re-added. Verified with a full local build: - build completes, /404 renders, 3115 HTML files - paginator pages back to 101 en / 29 lt, identical to pre-#33 - noindex present on /tags/, /categories/, /series/, term pages, and their pager pages, in both languages, 1343 pages total - noindex absent on /404, /, /page/2/, /fpv/, /fpv/page/2/, /lt/, /snippets/ and all regular posts
#33 noindexed all three taxonomies. The sitemap override in f8d0102 keeps categories and series listed on purpose, its own comment says they are curated, so 47 sitemap URLs were being advertised and noindexed at the same time: 37 category pages and 10 series pages. Conflicting signals. Narrow the noindex to the tags taxonomy, which is the one the sitemap also drops, and read the set from a single site param so the two templates cannot drift apart again. That drift is what produced the contradiction. params.toml thinTaxonomies = ["tags"] layouts/sitemap.xml excludes it from <urlset> hooks/head-end.html serves it noindex, follow Both templates default to slice "tags" if the param is missing, so a config edit cannot silently un-noindex or re-list the tag archive. Note this changes index hygiene, not crawl load. noindex is an indexing directive, Googlebot must fetch the page to read it, and "follow" keeps it traversing. robots.txt stays Allow: / deliberately. The crawl-budget lever was the sitemap change in f8d0102, measured here at 578 sitemap URLs covering 531 of 533 real content pages with zero tag pages. Verified with a full local build, hugo 0.163.3 extended, CI flags: - build completes, /404 renders, paginator pages 101 en / 29 lt - noindex present on /tags/, /tags/<term>/ and their pager pages, both languages, 1292 pages, and nothing outside /tags/ - noindex absent on /404, /, /page/2/, /categories/, /categories/fpv/, /categories/fpv/page/2/, /series/, /fpv/, /fpv/page/2/, /lt/, /lt/categories/, /snippets/ and all regular posts - sitemap 578 URLs: 0 tags, 37 categories, 10 series, and 0 of the 578 carry a noindex tag
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.
Fixes the CI failure introduced by #33, and resolves a conflicting-signal defect it also introduced.
1. The build break
hooks/head-end.htmlrenders from the<head>in the theme'sbaseof.html..Paginatorhard-errors on any page kind that cannot paginate, and/404is one. Reproduced locally with hugo 0.163.3 extended, byte-identical error.Guarding the call by kind is worse than removing it.
head-endruns before themainblock, so touching.Paginatorinitialises pagination before the theme'sarchive.htmlcalls.Paginate $pageswith its own page set:.PaginatorThe 34 extra pages are the home paginator switching from
mainSections(3 pager pages) to allRegularPages(30, stuffed with snippets), plus spurious/page/1/duplicates onsnippets/and all eight snippet subsections in both languages.So the clause is removed, not guarded. A comment in the partial records why, so the test does not get re-added.
Pager pages need no special handling anyway: Hugo re-renders the same Page for each pager, so
.Kindand.Data.Pluralhold on/tags/page/7/and/tags/fpv/page/3/too. The 6 URLs not covered that way (page/2,page/3,lt/page/2,fpv/page/2,lt/fpv/page/2and its en counterpart) are left indexable deliberately: hugo 0.163 exposes no read-only pager accessor, and.Permalinkdoes not vary between pager renders.2. Tags only, from one shared list
#33 noindexed
taxonomyandtermfor all three taxonomies. The sitemap override inf8d0102keeps categories and series listed on purpose. Its own header comment:So 47 sitemap URLs were being advertised and noindexed simultaneously: 37 category pages, 10 series pages.
Narrowed to the tags taxonomy, driven by a single param so the templates cannot drift apart again:
layouts/sitemap.xmlexcludes it from the<urlset>hooks/head-end.htmlserves itnoindex, followBoth default to
slice "tags"if the param goes missing, so a config edit cannot silently un-noindex or re-list the tag archive.Scope note: this is index hygiene, not crawl reduction
noindexis an indexing directive. Googlebot must fetch the page to read it, andfollowkeeps it traversing.robots.txtstaysAllow: /deliberately, because combiningDisallowwithnoindexon the same URL means the noindex is never seen.The crawl-budget lever was already
f8d0102, and it works. Measured: 578 sitemap URLs covering 531 of 533 real content pages, zero tag pages. The two absent are homepage/2andpage/3, which is correct.Verification
Full local build, hugo 0.163.3 extended, same flags as CI:
/404renders, paginator pages back to 101 / 29, identical to pre-seo: noindex taxonomy, term, and paginated pages #33noindex, followpresent on/tags/,/tags/<term>/and their pager pages, both languages, 1292 pages, and nothing outside/tags/noindexabsent on/404,/,/page/2/,/categories/,/categories/fpv/,/categories/fpv/page/2/,/series/,/fpv/,/fpv/page/2/,/lt/,/lt/categories/,/snippets/, all regular postsTwo verification traps worth recording, both of which produced a false all-clear first time:
--minifystrips attribute quotes, so the output is<meta name=robots ...>. A quoted-attribute grep matches nothing and reports zero noindex tags on a working build./sitemap.xmlis a<sitemapindex>; the URLs live in/en/sitemap.xmland/lt/sitemap.xml. Reading the root file alone makes the sitemap look near-empty.