Adding pagination

I have the following index.html. What would the simplest way to paginate it be?

{{ partial "header.html" . }}
<article>
{{ range .Site.RegularPages }}
<section class="note" id="{{ .Date.Unix }}">
<div class="note-date">
<a href="#{{ .Title | urlize }}" title="Permalink">&#8984; {{ .Date.Format "02 Jan 2006 / 15:04:05" }}</a></div>
<div class="note-body">
{{ .Content }}
</div>
</section>
{{ end }}
</article>
{{ partial "footer.html" . }}

The generic construct for pagination is something like:

{{ range (.Paginate site.RegularPages).Pages }}
  <h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
{{ end }}
{{ template "_internal/pagination.html" . }}
1 Like

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