]> git.maquefel.me Git - brevno-suite/hugo/commit
hugolib: Fix automatic section pages not replaced by sites.complements
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 20 Feb 2026 17:47:25 +0000 (18:47 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 20 Feb 2026 20:23:20 +0000 (21:23 +0100)
commita18bec1123e582da818dc8a841285d1a8eb27de4
tree45e834c09f84beecf7eb9461f5751e219a5442e8
parent3c9b41f9eca0362ef14cddf7af9809f509c21327
hugolib: Fix automatic section pages not replaced by sites.complements

When a home page or section page in language A is backed by a file and
language B has no content file for that section, the automatic page for
language B was not replaced by the complement from language A. This
happened because:

1. The content node shifter returned auto pages (not backed by files) as
   exact matches without trying complement fallback.
2. findContentNodeForSiteVector immediately returned auto pages as exact
   matches without considering file-backed complements.
3. getPagesInSection used Get (no fallback) for IncludeSelf, preventing
   complement resolution for home/section pages.

Fix by preferring file-backed complement pages over auto pages in the
shift and lookup mechanisms, and using fallback for self-inclusion.

Fixes #14540

Co-Authored-By: Joe Mooring <joe.mooring@veriphor.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
hugolib/content_map_page.go
hugolib/content_map_page_contentnode.go
hugolib/content_map_page_contentnodeshifter.go
hugolib/doctree/nodeshifttree.go
hugolib/sitesmatrix/sitematrix_integration_test.go