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}}
Hey Tarmo, thanks for your reply,
yes, you are right in this special case the condition within the range would work, I am gonna use that.
In other cases that I need to handle though, the condition needs to be within the range itself. To be more specific: when working with the paginator I can’t have the if, because that might render empty pages.
@bep
Thank you for your reply, I am looking forward to v0.25 then to make it proper.