i have a similiar problem:
data/contact_person.json
[
{
"name": "Smith",
"marketing": "yes",
"graphic": "no",
"selling": "yes",
},
{
"name": "Johnson",
"marketing": "no",
"graphic": "yes",
"selling": "yes",
},
]
contact.md
---
title: "contact"
slug: "contact"
contactPerson: "marketing"
---
single.html
{{ .Scratch.Set "department" .Params.contactPerson }}
{{ partial "contact_person" . }}
partial contact_person.html
{{ $contactDepartment := .Scratch.Get "department" }}
{{ $contactDepartment }} // = marketing WORKS! but not in the range argument. :(
{{ range where (where site.Data.contact_person "$contactDepartment" "yes") site.Language.Lang "de" }}
Name: {{ .name }}
{{ end }}
it ignores the var “$contactDepartment” totally.
if i put “marketing” instead of “$contactDepartment” in the range argument it works!