mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
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
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user