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 }}
-
- {{ range .Pages -}}
- -
-
-
-
{{ .Date.Format ($.Param "time_format_blog") }} {{ T "ui_in"}} {{ .CurrentSection.LinkTitle }}
-
- {{ partial "taxonomy_terms_article_wrapper.html" . -}}
- {{ if (and (not .Params.hide_readingtime) (.Site.Params.ui.readingtime.enable)) -}}
- {{ partial "reading-time.html" . -}}
- {{ end -}}
-
- {{ partial "featured-image.html" (dict "p" . "w" 250 "h" 125 "class" "float-start me-3 pt-1 d-none d-md-block") -}}
-
{{ .Plain | safeHTML | truncate 250 }}
-
{{ T "ui_read_more"}}
-
-
- {{ end -}}
-
+ {{ $pager := .Paginate (( $.Scratch.Get "blog-pages").GroupByDate "2006" ) -}}
+ {{ range $pager.PageGroups -}}
+
{{ T "post_posts_in" }} {{ .Key }}
+
+ {{ range .Pages -}}
+ -
+
+
+
+ {{- .Date.Format ($.Param "time_format_blog") }} {{ T "ui_in"}} {{ .CurrentSection.LinkTitle -}}
+
+
+ {{- partial "taxonomy_terms_article_wrapper.html" . -}}
+ {{ if (and (not .Params.hide_readingtime) (.Site.Params.ui.readingtime.enable)) -}}
+ {{- partial "reading-time.html" . -}}
+ {{ end -}}
+
+ {{- partial "featured-image.html" (dict "p" . "w" 250 "h" 125 "class" "float-start me-3 pt-1 d-none d-md-block") -}}
+
{{ .Plain | safeHTML | truncate 250 }}
+
{{ T "ui_read_more"}}
+
+
{{ end -}}
- {{ end }}
+
+ {{ end -}}
+{{- end -}}
{{ end -}}