Getting a page list from 2 categories


I’m trying to generate a list of pages that belong to two categories. This is important for me since I plan to have subcategories with the same name. In analogy to cars:

Audi              <-- section
    Car name A    <-- (categories = ["Audi", "4WD"])
    Car name B    <-- (categories = ["Audi", "Cabriolet"])
BMW               <-- section
    Car name C    <-- (categories = ["BMW", "4WD"])
    Car name D    <-- (categories = ["BMW", "Cabriolet"])

Based off the docs I came up with this pseudocode:

{{ range and (where $.Site.Pages ("Params.categories" "Audi"))
             (where $.Site.Pages ("Params.categories" "4WD")) }}

    <li>{{ .Title }}</li>
{{ end }}

Can someone help me come up with the correct code for this use case? Thanks!

Can someone help me with this? Even a snippet that shows me how to use where to get posts from one category would be very helpful.

Sorry to bump this, but it’s important for me because my Hugo is so slow due to inefficient code, but I can’t make the presumably more efficient where work.