mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
Add option to not generate aliases for first page of pagination pages
Also consolidate the pagination configuration into a struct. Closes #12572
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user