]> git.maquefel.me Git - brevno-suite/hugo/commit
tpl/collections: Honor the Eqer interface in where comparisons
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 20 Apr 2026 16:12:29 +0000 (18:12 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 20 Apr 2026 17:45:06 +0000 (19:45 +0200)
commitf5fce935e768f4c301fb5c825e512a17f8a13e2e
tree9375435a73d5b0dc1d64c9eee1d8a8b813e1ef03
parent52123ae23f38ed474e3414ba386cbb47c4539f0c
tpl/collections: Honor the Eqer interface in where comparisons

The where function previously fell through to a no-op when comparing
two values whose kinds were not handled by the primitive type switches
(e.g. two Page interface values). This made `where pages "Parent" $page`
return an empty list, while the equivalent `range pages` + `if eq` worked.

Use compare.Eqer for equality operators when either side implements it,
matching the behavior of the eq/ne template funcs.

Fixes #14777

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
tpl/collections/collections_integration_test.go
tpl/collections/where.go