aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/site_render.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2019-04-10 10:11:51 +0200
committerBjørn Erik Pedersen <[email protected]>2019-04-12 09:18:59 +0200
commitf7375c497239115cd30ae42af6b4d298e4e7ad7d (patch)
treecb21a9da3a26a0e151b11d5117454c74b3a95136 /hugolib/site_render.go
parent7966c0b5b7b2297527f8be9040b793de5e4e3f48 (diff)
downloadhugo-f7375c497239115cd30ae42af6b4d298e4e7ad7d.tar.gz
hugo-f7375c497239115cd30ae42af6b4d298e4e7ad7d.zip
Fix paginator refresh on server change
Fixes #5838
Diffstat (limited to 'hugolib/site_render.go')
-rw-r--r--hugolib/site_render.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/hugolib/site_render.go b/hugolib/site_render.go
index 760704053..407061b67 100644
--- a/hugolib/site_render.go
+++ b/hugolib/site_render.go
@@ -171,12 +171,9 @@ func (s *Site) renderPaginator(p *pageState, layouts []string) error {
f := p.s.rc.Format
d.Type = f
- // Rewind
- p.paginator.rewind()
- defer func() {
- // Prepare for any re-rendering in server mode.
- p.paginator.rewind()
- }()
+ if p.paginator.current == nil || p.paginator.current != p.paginator.current.First() {
+ panic(fmt.Sprintf("invalid paginator state for %q", p.pathOrTitle()))
+ }
// Write alias for page 1
d.Addends = fmt.Sprintf("/%s/%d", paginatePath, 1)