diff options
author | Bjørn Erik Pedersen <[email protected]> | 2020-01-30 18:35:40 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2020-01-30 23:45:19 +0100 |
commit | 2d159e9cc7a25832e4b0cad226b149f7c4624708 (patch) | |
tree | 70f3f72c916b03fd34460392dd52d8200e108e8f /hugolib/site_render.go | |
parent | f45cb3172862140883cfa08bd401c17e1ada5b39 (diff) | |
download | hugo-2d159e9cc7a25832e4b0cad226b149f7c4624708.tar.gz hugo-2d159e9cc7a25832e4b0cad226b149f7c4624708.zip |
Do not render alias paginator pages for non-HTML outputs
Update #6797
Diffstat (limited to 'hugolib/site_render.go')
-rw-r--r-- | hugolib/site_render.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/hugolib/site_render.go b/hugolib/site_render.go index 59f265996..dd79a7264 100644 --- a/hugolib/site_render.go +++ b/hugolib/site_render.go @@ -205,12 +205,14 @@ func (s *Site) renderPaginator(p *pageState, templ tpl.Template) error { panic(fmt.Sprintf("invalid paginator state for %q", p.pathOrTitle())) } - // Write alias for page 1 - d.Addends = fmt.Sprintf("/%s/%d", paginatePath, 1) - targetPaths := page.CreateTargetPaths(d) + if f.IsHTML { + // Write alias for page 1 + d.Addends = fmt.Sprintf("/%s/%d", paginatePath, 1) + targetPaths := page.CreateTargetPaths(d) - if err := s.writeDestAlias(targetPaths.TargetFilename, p.Permalink(), f, nil); err != nil { - return err + if err := s.writeDestAlias(targetPaths.TargetFilename, p.Permalink(), f, nil); err != nil { + return err + } } // Render pages for the rest |