$published is always empty with the following code…
<div class="content">
{{ $functions := where $.Site.Data.functions "category" (.Title | lower)}}
{{ $published := where $.Site.Data.functions "version.mode" 1}}
{{ $filtered := intersect $functions $published }}
{{- range $filtered }} {{- partial "function.html" . -}} {{ end -}}
</div>
where Data.functions looks like:
[
{
"name": "one",
"category": "math",
"version": {
"mode": 1,
}
},
{
"name": "zero",
"category": "math",
"version": {
"mode": 0,
}
}
]