Hi all, I’m a total newbie to Hugo. I’m trying to display some blog posts on the home page that match 2 criteria:
- They are of the blog content type
- They have a front matter parameter of “homepage” set to “true”
Here’s what I have so far:
{{ range first 3 (where .Data.Pages "Type" "blog") }}
How can I add an additional AND clause something like:
(where "Params.homepage" "eq" "true")
-------------------------------------- UPDATE ---------------------------------------
I ended up having to modify the query, opening it up to any pages / sections that had the homepage frontmatter field so we could include more than just the blog section so no longer and IF / AND
For anyone that’s interested here’s what I came up with:
{{ $pages := where .Pages ".Params.homepage" "==" true}}
{{ range first 4 $pages }}