I have the following array set {{ $the_features := (slice "10" "20" "30") }}
in a partial template file
A features.toml
exists within the data folder and contains a multi dimensional array each array contains a .number
key with a number value such as 10
I have a range looping over the features data and trying to check if any of the .number
values match the array values above
This isn’t returning anything.
{{ range .Site.Data }}
{{ range .features }}
{{ if in .number $the_features }}
{{ . }}
{{ end }}
{{ end }}
{{ end }}
What’s wrong with this if condition?
This however works, which illustrates what i’m trying to match.
{{ if eq .number 10 }} // .number here is 10 so 10 equals 10.
{{ .number }}
{{ end }}
Thanks