Filtering pages and blog posts when all content is placed under root /content directory

I’m creating a simple blog for a family member to publish their content. In this instance all the content lives under the root /content directory. Within the content are a handful of pages, the rest are all “blog posts”.

On the homepage I want to create a list of all the blog posts, but I want to filter out the pages. Is it possible to filter out the pages?

All of the blog posts use a different theme theme template that lives at _default/post.html. Is it possible to filter by the layout type maybe?

I did it:

<ul>
	{{ range where .Pages "Layout" "article" }}
   	<li>
 		<a href="{{.Permalink}}">{{ .Title }}</a>
   	</li>
    {{ end }}
</ul>

To make this work I have to add layout = "single" to the frontmatter for regular pages.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.