Get All Posts Of Certain Archetype

I have some posts in content/projects. I would like to be able to display a list of only these project posts.

Is there a variable I can access these posts in? Perhaps something like .Data.Projects?

In a list template (layouts/projects/list.html or layouts/default/list.html) you can use something like

{{ range .Pages }}
    // stuff here
{{ end }}

which is handy because you can use this in a default template for any section.

If you’re outside of those you’ll want something more like

{{ range where .Site.RegularPages "Section" .Section }}
    //stuff  
{{ end }}

If you always want a specific section, replace .Section with "the-actual-section-name"

There are other approaches. Hope that helps. Dig into the docs some more, it’s all there.

2 Likes

Hey there,

Thanks for the response!

That’s exactly what I was looking for.

I was looking through the docs for a solid two hours before I resorted to posting a question here :slight_smile:

Would you mind linking to the specific documentation page?

You can find the doc about order, group content. filter and limiting list in the link below

2 Likes