diff --git a/layouts/index.html b/layouts/index.html
index 82f82c1..cb10895 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,4 +1,5 @@
{{ define "content" }}
+{{ $paginator := (.Paginate (where (where .Site.RegularPages "Type" "in" site.Params.mainSections) ".Params.hidden" "!=" "true" )) }}
{{ if eq .Paginator.PageNumber 1 }}
@@ -15,7 +16,7 @@
{{ end }}
{{ end }}
- {{ range $index, $page := (.Paginate (where (where .Site.RegularPages "Type" "in" site.Params.mainSections) ".Params.hidden" "!=" "true" )).Pages }}
+ {{ range $index, $page := $paginator.Pages }}
{{ if ne $index 0 }}
{{ end }}
{{ .Render "summary" }}