summaryrefslogtreecommitdiff
path: root/layouts/_default
diff options
context:
space:
mode:
authornanxiaobei <nanxiaobei@gmail.com>2019-08-21 12:07:27 +0800
committernanxiaobei <nanxiaobei@gmail.com>2019-08-21 12:07:27 +0800
commitc1a940e084034859a7fc3988244611d730c91d83 (patch)
tree6467e016d3bfb21eb690076a5440535cf8184a46 /layouts/_default
parent6a21a64488751587461f0bd129847b91e82c812b (diff)
Fix context
Diffstat (limited to 'layouts/_default')
-rw-r--r--layouts/_default/list.html8
1 files 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 }}
<header class="page-header">
<h1>{{ if eq .Data.Singular "tag" }}{{ .Data.Term }}{{ else }}Posts{{ end }}</h1>
</header>
{{ 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 }}