I tried to solve this problem for a few days (I probably read every “range thread” in hugo discourse)
The best solution what I have:
{{ range $feed := .Site.Data.mydata }}
{{ range ( where $feed.PARAM "VAL" "eq" "camel" ) }}
{{ if in $feed.CATEGORYTEXT "crossbody" }}
<li>
{{ $feed.PRODUCT }}
</li>
{{ end }}
{{ end }}
{{ end }}
-
where to add
first
function ? (the highest priority)
{{ range first 10 ( where $feed.PARAM "VAL" "eq" "camel" ) }}
is not working -
how to add another value of “VAL” parameter
something like:
{{ range ( where $feed.PARAM "VAL" "eq" ("camel" or "cafe" ) }}
-
is possible to replace
if
condition forwhere
? something like:
{{ range where ( where $feed.PARAM "VAL" "eq" "camel" ) in $feed.CATEGORYTEXT "crossbody" }}
[Repo with code] (hugo-range-first-where-nested-data/index.html at master · zdenekpribyla/hugo-range-first-where-nested-data · GitHub)
[Repo json data file] (https://raw.githubusercontent.com/zdenekpribyla/hugo-range-first-where-nested-data/master/data/mydata.json)
Thank you for any help