From c1a940e084034859a7fc3988244611d730c91d83 Mon Sep 17 00:00:00 2001 From: nanxiaobei Date: Wed, 21 Aug 2019 12:07:27 +0800 Subject: [PATCH] Fix context --- layouts/_default/list.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/layouts/_default/list.html b/layouts/_default/list.html index b7dc3ef..4c84589 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,12 +1,16 @@ {{ partial "header.html" . }} -{{ if not .IsHome }} +{{ $pctx := . }} + +{{ if .IsHome }} +{{ $pctx = .Site }} +{{ else }} {{ end }} -{{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }} +{{ $paginator := .Paginate (where $pctx.RegularPages "Type" "in" .Site.Params.mainSections) }} {{ if gt $paginator.TotalPages 0 }} {{ range $index, $page := $paginator.Pages }}