fix(series): look up multi-word series names via Taxonomy.Get, not anchorize (#1011)
Fixes #980.
`layouts/_partials/posts/series.html` looked up a series' pages by
running the front-matter value through `anchorize` (`"Some Series Name
with Spaces"` → `"some-series-name-with-spaces"`) and indexing
`$.Site.Taxonomies.series` with that hyphenated string. Hugo's own
`Taxonomy.Get` (`resources/page/taxonomy.go` in Hugo core) only
lowercases the key - it doesn't hyphenate it - so the real map key for a
multi-word term is `"some series name with spaces"` (lowercase, spaces
intact). Any series name with more than one word therefore never
matched, and the whole "See also in ..." block silently rendered
nothing, exactly as your debug output in the issue showed.
Swapped the manual `anchorize` + `index` for
`$.Site.Taxonomies.series.Get .` (the built-in accessor, which does the
correct lowercase-only normalization) - same `WeightedPages` return
type, so `$series.Pages` and everything after it is untouched. The other
two `anchorize` calls in the file are for the heading's HTML `id`/anchor
link, a genuinely different purpose (URL-safe fragment), so I left those
alone.
Verified by actually building the exampleSite through the theme (not
just reading the template): added two posts sharing `series: ["Some
Series Name with Spaces"]`, confirmed the unmodified template really
does render an empty `<section class="see-also">` with no heading or
link (reproducing the bug), then confirmed the fix produces `<h3>See
also in Some Series Name with Spaces</h3>` with a working link to the
sibling post.
Co-authored with Claude Code (Anthropic); reviewed by @si-kui-a before
submission.
Co-authored-by: lilichen-F <147837261+lilichen-F@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>