Hello,
I want to build a website with three pages (home, blog, about).
So I have organized my /content and /layouts folders like this:
/content
content
posts
- post1.md
- post2.md
pages
- blog.md
- about.md
/layouts
layouts
- _default
- baseof.html
- list.html
- single.html
pages
- blog.html
- single.html
posts
- list.html
- single.html
- index.html
All post_x.md have the parameter type: “posts” in front matter.
In the blog.html, I loop on the posts like this:
<ul>
{{ range (where .Site.Pages ".Type" "posts") }}
<li>
{{ .Title }}
</li>
{{ end }}
</ul>
With this loop, I get post1, post2 and posts
Why do I get “Posts” as a post? … “posts” is a section not a post :-/
Is there something wrong in my loop ? How to remove “posts” from the result of my loop?