I am having trouble generating a list of blog posts and projects on my index page.
I have 2 sections: blog
and projects
.
In /layout/index.html
I have:
<h3>blog</h3>
<ul>
{{- range (.Paginate (where site.RegularPages "Section" "blog" | first 3 )).Pages }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{- end -}}
</ul>
<h3>projects</h3>
<ul>
{{- range (.Paginate (where site.RegularPages "Section" "projects" | first 3 )).Pages }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{- end -}}
</ul>
And this content
directory.
content
βββ blog
β βββ 1.md
βββ contact.md
βββ projects
βββ 2.md
1.md
looks like this:
---
title: 11
---
111
Same for 2.md
, except with 2s instead of 1s.
So, with this configuration, I would expect my generated list to be something like:
blog
- 11
projects
- 22
However, I get this:
What am I doing wrong? If this is a bug, what can I do to work around it?