diff --git a/layouts/blog/list.html b/layouts/blog/list.html index 43f536ae9c..2dc8b18719 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -1,40 +1,41 @@ -{{ define "main" }} +{{ define "main" -}} + {{ if (and .Parent .Parent.IsHome) -}} {{ $.Scratch.Set "blog-pages" (where .Site.RegularPages "Section" .Section) -}} {{ else -}} {{$.Scratch.Set "blog-pages" .Pages -}} {{ end -}} +{{- if .Pages -}}
- {{ if .Pages -}} - {{ $pag := .Paginate (( $.Scratch.Get "blog-pages").GroupByDate "2006" ) -}} - {{ range $pag.PageGroups -}} -
{{ T "post_posts_in" }} {{ .Key }}
- + {{ $pager := .Paginate (( $.Scratch.Get "blog-pages").GroupByDate "2006" ) -}} + {{ range $pager.PageGroups -}} +
{{ T "post_posts_in" }} {{ .Key }}
+ + {{ end -}}
- {{ if .Pages -}} - {{ template "_internal/pagination.html" . -}} - {{ end -}} + {{ template "_internal/pagination.html" . -}}
+{{- end -}} {{ end -}}