For me, it helped to add a layouts/index.html
file to my theme. Here is its content:
{{ define "main" }}
{{ $pag := .Paginate (where site.RegularPages "Type" "in" site.Params.mainSections ) 6 }}
<div class="archive-body">
{{ range $pag.Pages }}
{{ .Render "li" }}
{{ end }}
</div>
{{ partial "pagination" . }}
{{ end }}
"li"
is a partial HTML template, which renders a single page for me.
Then I had to specify mainSections
in my config.toml
. Since my content is located inside content/post
directory, here is the configuration.
[params]
mainSections = ["post"]
Since this is a list, you should be able to add more than one section. For example, if your content is spread let's say between content/post
and content/articles
and so on. I haven't tried this, though.