diff options
Diffstat (limited to 'hugolib/page__paginator.go')
-rw-r--r-- | hugolib/page__paginator.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/hugolib/page__paginator.go b/hugolib/page__paginator.go index 709f0e9ea..2ec89561c 100644 --- a/hugolib/page__paginator.go +++ b/hugolib/page__paginator.go @@ -16,6 +16,7 @@ package hugolib import ( "sync" + "github.com/gohugoio/hugo/common/herrors" "github.com/gohugoio/hugo/resources/page" ) @@ -44,7 +45,7 @@ func (p *pagePaginator) reset() { func (p *pagePaginator) Paginate(seq any, options ...any) (*page.Pager, error) { var initErr error p.init.Do(func() { - pagerSize, err := page.ResolvePagerSize(p.source.s.Cfg, options...) + pagerSize, err := page.ResolvePagerSize(p.source.s.Conf, options...) if err != nil { initErr = err return @@ -69,9 +70,11 @@ func (p *pagePaginator) Paginate(seq any, options ...any) (*page.Pager, error) { } func (p *pagePaginator) Paginator(options ...any) (*page.Pager, error) { + defer herrors.Recover() + var initErr error p.init.Do(func() { - pagerSize, err := page.ResolvePagerSize(p.source.s.Cfg, options...) + pagerSize, err := page.ResolvePagerSize(p.source.s.Conf, options...) if err != nil { initErr = err return |