diff options
author | Bjørn Erik Pedersen <[email protected]> | 2019-04-07 21:59:37 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2019-04-08 11:02:12 +0200 |
commit | 612a06f0671125be6b42ec2982a18080005994c8 (patch) | |
tree | 97da279b738b2f6f0bfb25e2eac8002af3b6d1e0 /hugolib/site_render.go | |
parent | 3db4a1cf7ab12343ce5705ac56aa7ca6ea1677b6 (diff) | |
download | hugo-612a06f0671125be6b42ec2982a18080005994c8.tar.gz hugo-612a06f0671125be6b42ec2982a18080005994c8.zip |
Misc paginator adjustments
* Rewind paginator for server mode
* Add some more related tests.
* Replace the clumsy scratch constructs in internal paginator template with variables
See #5825
Diffstat (limited to 'hugolib/site_render.go')
-rw-r--r-- | hugolib/site_render.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/hugolib/site_render.go b/hugolib/site_render.go index 1d8b14b0a..760704053 100644 --- a/hugolib/site_render.go +++ b/hugolib/site_render.go @@ -172,7 +172,11 @@ func (s *Site) renderPaginator(p *pageState, layouts []string) error { d.Type = f // Rewind - p.paginator.current = p.paginator.current.First() + p.paginator.rewind() + defer func() { + // Prepare for any re-rendering in server mode. + p.paginator.rewind() + }() // Write alias for page 1 d.Addends = fmt.Sprintf("/%s/%d", paginatePath, 1) |