× Search About Posts Code Music Links
Blank Try
experiment
lots
learn
more

Pagination

Updated on
Last site update: 8 May 2024

How the blank theme does pagination.

The Hugo default value for pagination is 10, meaning it will list out the first 10 posts or articles etc. before creating a new page. To change this simply add this line to the config file:

1paginate = 16

Here’s the code from pagination.html partial:

1<div>
2{{ if .Paginator.HasPrev }}
3	<a href="{{ .Paginator.Prev.URL }}">Previous Page</a>
4{{ end }}
5{{ .Paginator.PageNumber }} of {{ .Paginator.TotalPages }}
6{{ if .Paginator.HasNext }}
7	<a href="{{ .Paginator.Next.URL }}">Next Page</a>
8{{ end }}
9</div>