diff options
author | Bjørn Erik Pedersen <[email protected]> | 2024-06-07 17:38:33 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-06-08 15:42:01 +0200 |
commit | 9c4e14eb4f890d2a3caad2dcd9209609b7274914 (patch) | |
tree | e860d7bb4bbcc10f2783f706bdcde43d5de351de /hugolib | |
parent | 1cdd3d0a9e4a988fb505a1bcbb3e7692b64bef55 (diff) | |
download | hugo-9c4e14eb4f890d2a3caad2dcd9209609b7274914.tar.gz hugo-9c4e14eb4f890d2a3caad2dcd9209609b7274914.zip |
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 'hugolib')
-rw-r--r-- | hugolib/site_render.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hugolib/site_render.go b/hugolib/site_render.go index 1cd509fea..a7ecf89af 100644 --- a/hugolib/site_render.go +++ b/hugolib/site_render.go @@ -223,7 +223,7 @@ func (s *Site) logMissingLayout(name, layout, kind, outputFormat string) { // renderPaginator must be run after the owning Page has been rendered. func (s *Site) renderPaginator(p *pageState, templ tpl.Template) error { - paginatePath := s.conf.PaginatePath + paginatePath := s.Conf.Pagination().Path d := p.targetPathDescriptor f := p.s.rc.Format @@ -233,7 +233,7 @@ func (s *Site) renderPaginator(p *pageState, templ tpl.Template) error { panic(fmt.Sprintf("invalid paginator state for %q", p.pathOrTitle())) } - if f.IsHTML { + if f.IsHTML && !s.Conf.Pagination().DisableAliases { // Write alias for page 1 d.Addends = fmt.Sprintf("/%s/%d", paginatePath, 1) targetPaths := page.CreateTargetPaths(d) |