Hi Leo,
Looks like in
can be used in two different context. First, as operator in where condition. In this context it checks if left argument exists in array on the right, so you could use it like following.
where .Data.Pages ".File.Dir" "in" (slice "guidelines/EN/text/" "guidelines/DE/text/")
Second scenario is logical function comparing substrings (in "big main string" "substring")
I’m not sure if where
can be convinced somehow to use logical functions but even if it can’t there is easy workaround.
{{ range $index, $element := where .Data.Pages "Type" "eq" "guideline" }}
{{ if (in $element.File.Dir "/text/") }}
Do your magic stuff here
{{end}}
{{end}}
Best Regards,
Tarmo