Multiple types in a list range

I am trying to pull in two different types of posts into one list.html template. In the layouts/blog/list.html template, I have:

{{ $pag := .Paginate (where .Data.Pages "Type" "in" (slice "micro" "blog")) }}
{{ range $pag.Pages }}
    {{ partial "article.html" . }}
{{ end }}
{{ partial "pagination" . }}

(This is using pagination, but that shouldn’t complicate matters)

This is only displaying “blog” posts and not anything else. Can I not do this? Hugo is not throwing any errors. I have “micro” content posts set up exactly as I do “blog” ones (I believe).

.Data.Pages will, for most list pages (the exception being the home page and the taxonomy lists) contain only 1 Type. Not sure what you want, but try:

{{ $pag := .Paginate (where .Site.RegularPages "Type" "in" (slice "micro" "blog")) }}
3 Likes

That did it, thanks @bep