I want to get a list of content from a certain section that has a certain front matter variable set.
My attempt:
{{ $section := where .Site.RegularPages "Section" .Section }}
{{ $refcontent := where .Site.RegularPages ".Params.contenttype" "reference" }}
{{ $refArticles := intersect $section $refcontent | shuffle }}
Problem is that the intersect
array is empty. I know for a fact that this is incorrect, since I created content files in the current section that has that particular front matter variable.
If I use the len
function to check the arrays’ length, all arrays except the intersect
one contain content.
Using the where
function with intersect
gives the same problem.
{{ range where .Site.RegularPages ".Section" "intersect" $refcontent }}
<!-- ... -->
{{ end }}
Any ideas where I go wrong?