I’m creating posts by category. But I found one problem. I use the code below to display posts based on the desired category. But this code is not working and why ?
{{ $category := .Scratch.Get "category" }}
{{ range $i, $item := first 5 (where .Site.RegularPages ".Params.category" "in" $category) }}
//content summary
{{ end }}
I tried using this code for other cases but the same, but the code below works instead.
{{ range $i, $item := first 5 (where .Site.RegularPages ".Params.featuredPost" "=" true) }}
//content summary
{{ end }}
Please, help me to solve this problem.Thanks!