From 9c4e14eb4f890d2a3caad2dcd9209609b7274914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Fri, 7 Jun 2024 17:38:33 +0200 Subject: Add option to not generate aliases for first page of pagination pages Also consolidate the pagination configuration into a struct. Closes #12572 --- resources/page/pagination.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'resources') 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 } -- cgit v1.2.3