arrow_back
Back

Hugo pagination: Paginator, page size, and Bootstrap markup

Andrew Dorokhov Andrew Dorokhov schedule 1 min read
menu_book Table of Contents

In list templates, paginate with .Paginator.Pages instead of .Pages:

{{ range .Paginator.Pages }}

Default page size is 10. Override per call:

{{ range (.Paginator 5).Pages }}

Render controls with the built-in template (Bootstrap-compatible markup):

{{ template "_internal/pagination.html" . }}

Config

Set the global page size in config.toml:

paginate = 10
code

Need Help with Development?

Happy to help — reach out via the contacts or go straight to my Upwork profile.

work View Upwork Profile arrow_forward
Next Article

Hugo taxonomies: tags, categories, terms layouts, and disabling

arrow_forward