Hugo can't resolve the following template construct since the starting sequence is a map:
{{ range where .Site.Data.person "name" "Victor Hugo" }}
Extend where to iterate over maps.
See Tutorial: Link .Site.Data to Content Types by Filename discussion.
Is that even correct syntax? Shouldn't it be
{{ range where .Site.Data.person ".name" "eq" "Victor Hugo" }}
I believe where defaults to eq if not present.
+1 from me, I just ran into the exact same problem.
FWIW, this is what I ended up with, I'd be interested to know if there was something more elegant:
{{ $people := slice }}
{{ range .Site.Data.people }}{{ $people = $people | append . }}{{ end }}
{{ range where $people "name" "Victor Hugo" }}
{{ .twitter_handle }}
{{ end }}
Most helpful comment
+1 from me, I just ran into the exact same problem.
FWIW, this is what I ended up with, I'd be interested to know if there was something more elegant: