mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-29 07:00:31 +03:00
hugolib: Do not create paginator pages for the other output formats
This is a recent regression in Hugo, where we have started to produce `/page/30/index.json` when the main output format (usually `HTML`) is set up with pagination. For JSON this is potentially lot of superflous work and hurts performance. This commit reinstates the earlier behaviour: We only create paginators if in use in the main output format. And add a test for it to prevent this from happening again. Fixes #4890
This commit is contained in:
parent
dea71670c0
commit
43338c3a99
2 changed files with 15 additions and 2 deletions
|
@ -168,7 +168,8 @@ func pageRenderer(s *Site, pages <-chan *Page, results chan<- error, wg *sync.Wa
|
|||
results <- err
|
||||
}
|
||||
|
||||
if pageOutput.IsNode() {
|
||||
// Only render paginators for the main output format
|
||||
if i == 0 && pageOutput.IsNode() {
|
||||
if err := s.renderPaginator(pageOutput); err != nil {
|
||||
results <- err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue