{{ define "main" }} {{ if .Parent.IsHome }} {{ $.Scratch.Set "blog-pages" (where .Site.RegularPages "Section" .Section) }} {{ else }} {{$.Scratch.Set "blog-pages" .Pages }} {{ end }}
{{- if .Pages -}} {{ $pag := .Paginate (( $.Scratch.Get "blog-pages").GroupByDate "2006")}} {{ range $pag.PageGroups }}

{{ T "post_posts_in" }} {{ .Key }}

{{ end }} {{ end }}
{{ if .Pages }} {{ template "_internal/pagination.html" . }} {{ end }}
{{ end }}