分頁

本頁內容

該模塊附帶了一個通用的分頁模板,其允許通過參數進行配置,如對齊方式、尺寸和兄弟節點的數量。

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.

用法

模板接受一個 Paginator 變量。

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

Pagination example

站點參數

ParameterTypeRequiredDefaultDescription
alignmentstring-centercenterstart(左側)或 end(右側)。
sizestring--留空(中等), sm(小)或 lg(大)。
siblingsinteger-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}
razonyang
2024年7月26日 星期五 2023年5月13日 星期六