该模块附带了一个通用的分页模板,其允许通过参数进行配置,如对齐方式、尺寸和兄弟节点的数量。
| Module | github.com/hbstack/pagination | 
|---|---|
| Repository | ⭐ Please consider giving a star if your like it. | 
| Stars | |
| Version | |
| Used by | |
| Requirements | |
| License | |
| Usage | See how to use modules. | 
模板接受一个 Paginator 变量。
1{{ partial "hb/modules/pagination/index" .Paginator }}

| Parameter | Type | Required | Default | Description | 
|---|---|---|---|---|
alignment | string | - | center | center、start(左侧)或 end(右侧)。 | 
size | string | - | - | 留空(中等), sm(小)或 lg(大)。 | 
siblings | integer | - | 2 | 当前页码左右侧的兄弟节点数量。 | 
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}