Skip to content

fix: unbreak the build (/404), and noindex tags only - #34

Merged
foxis merged 2 commits into
mainfrom
fix/head-end-paginator-build-break
Sep 2, 2026
Merged

foxis merged 2 commits into
mainfrom
fix/head-end-paginator-build-break

Conversation

@foxis

@foxis foxis commented Sep 1, 2026 •

Copy link
Copy Markdown

Fixes the CI failure introduced by #33, and resolves a conflicting-signal defect it also introduced.

1. The build break

render of "/404" failed: ... at <.Paginator>: error calling Paginator: pagination not supported for this page

hooks/head-end.html renders from the <head> in the theme's baseof.html. .Paginator hard-errors on any page kind that cannot paginate, and /404 is one. Reproduced locally with hugo 0.163.3 extended, byte-identical error.

Guarding the call by kind is worse than removing it. 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:

build paginator pages (en / lt)
pre-#33 101 / 29
kind-guarded .Paginator 135 / 32

The 34 extra pages are the home paginator switching from mainSections (3 pager pages) to all RegularPages (30, stuffed with snippets), plus spurious /page/1/ duplicates on snippets/ 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 .Kind and .Data.Plural hold 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/2 and its en counterpart) are left indexable deliberately: hugo 0.163 exposes no read-only pager accessor, and .Permalink does not vary between pager renders.

2. Tags only, from one shared list

#33 noindexed taxonomy and term for all three taxonomies. The sitemap override in f8d0102 keeps categories and series listed on purpose. Its own header comment:

Categories (22) and series (5) are curated and stay listed.

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:

thinTaxonomies = ["tags"]   # config/_default/params.toml
  • layouts/sitemap.xml excludes it from the <urlset>
  • hooks/head-end.html serves it noindex, follow

Both 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

noindex is an indexing directive. Googlebot must fetch the page to read it, and follow keeps it traversing. robots.txt stays Allow: / deliberately, because combining Disallow with noindex on 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 home page/2 and page/3, which is correct.

Verification

Full local build, hugo 0.163.3 extended, same flags as CI:

  • build completes, /404 renders, paginator pages back to 101 / 29, identical to pre-seo: noindex taxonomy, term, and paginated pages #33
  • noindex, follow 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/, all regular posts
  • sitemap 578 URLs: 0 tags, 37 categories, 10 series, and 0 of the 578 carry a noindex tag

Two verification traps worth recording, both of which produced a false all-clear first time:

  • --minify strips 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.xml is a <sitemapindex>; the URLs live in /en/sitemap.xml and /lt/sitemap.xml. Reading the root file alone makes the sitemap look near-empty.

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
@foxis foxis changed the title fix: drop .Paginator from head-end — it breaks the build on /404 fix: unbreak the build (/404), and noindex tags only Sep 1, 2026
@foxis
foxis merged commit 6908a68 into main Sep 2, 2026
2 checks passed
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.

1 participant