summaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2024-06-07 17:38:33 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2024-06-08 15:42:01 +0200
commit9c4e14eb4f890d2a3caad2dcd9209609b7274914 (patch)
treee860d7bb4bbcc10f2783f706bdcde43d5de351de /resources
parent1cdd3d0a9e4a988fb505a1bcbb3e7692b64bef55 (diff)
Add option to not generate aliases for first page of pagination pages
Also consolidate the pagination configuration into a struct. Closes #12572
Diffstat (limited to 'resources')
-rw-r--r--resources/page/pagination.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/resources/page/pagination.go b/resources/page/pagination.go
index 4beb96e50..d24879e62 100644
--- a/resources/page/pagination.go
+++ b/resources/page/pagination.go
@@ -263,7 +263,7 @@ func splitPageGroups(pageGroups PagesGroup, size int) []paginatedElement {
func ResolvePagerSize(conf config.AllProvider, options ...any) (int, error) {
if len(options) == 0 {
- return conf.Paginate(), nil
+ return conf.Pagination().DefaultPageSize, nil
}
if len(options) > 1 {
@@ -400,7 +400,7 @@ func newPaginationURLFactory(d TargetPathDescriptor) paginationURLFactory {
pathDescriptor := d
var rel string
if pageNumber > 1 {
- rel = fmt.Sprintf("/%s/%d/", d.PathSpec.Cfg.PaginatePath(), pageNumber)
+ rel = fmt.Sprintf("/%s/%d/", d.PathSpec.Cfg.Pagination().Path, pageNumber)
pathDescriptor.Addends = rel
}