Pagination

On this page

This module ships with an universal pagination template, which allows configuring by parameters, such as alignment, size and the number of siblings.

Modulegithub.com/hbstack/pagination
Repository⭐ Please consider giving a star if your like it.
Stars
Version
Used by
Requirements
License
UsageSee how to use modules.

Usage

The template accepts a Paginator variable.

1{{ partial "hb/modules/pagination/index" .Paginator }}

Pagination example

Site Parameters

ParameterTypeRequiredDefaultDescription
alignmentstring-centercenter, start (left) or end (right).
sizestring--Empty (middle), sm (small) or lg (large).
siblingsinteger-2The number of siblings to the left/right of the current page number.

hugo.toml

1[params]
2  [params.hb]
3    [params.hb.pagination]
4      alignment = 'center'
5      siblings = 2
6      size = ''

hugo.yaml

1params:
2  hb:
3    pagination:
4      alignment: center
5      siblings: 2
6      size: ""

hugo.json

 1{
 2   "params": {
 3      "hb": {
 4         "pagination": {
 5            "alignment": "center",
 6            "siblings": 2,
 7            "size": ""
 8         }
 9      }
10   }
11}
razonyang
Monday, July 15, 2024 Saturday, May 13, 2023