I have run into this issue a couple of times now and have resorted to flattening my data structure in my frontmatter. This works, but I am still unclear as to whether I was doing something wrong here.
Does where simply not allow nested params?
To simplify my example:
country:
name: Hungary
code: HUN
continent: Europe
destination: Europe
This works:
{{ range where .Site.Pages "Params.destination" "Europe" }}
{{ .Content }}
{{ end }}
whereas this fails with error calling where: can't evaluate an invalid value:
{{ range where .Site.Pages "Params.country.continent" "Europe" }}
{{ .Content }}
{{ end }}
What’s the output if you use where with "Params.continent"?
I don’t know how custom front matter variables deal with the indentation in the front matter. I suspect they ignore it, so indenting continent below country might simply look as a continent variable to Hugo – and not as country.continent.