From bcec943a6b2c425df9fd05d2d7b57556016efaff Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Tue, 7 Jan 2025 16:34:37 -0500 Subject: [PATCH 1/2] Blog list layout refactoring --- layouts/blog/list.html | 55 +++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/layouts/blog/list.html b/layouts/blog/list.html index 43f536ae9c..fd6f3afe90 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -1,40 +1,39 @@ -{{ 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 -}} From d05947d4e556ed7faf845d88df384aa81484d4f1 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Tue, 7 Jan 2025 16:53:44 -0500 Subject: [PATCH 2/2] Formatting adjustment --- layouts/blog/list.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/layouts/blog/list.html b/layouts/blog/list.html index fd6f3afe90..2dc8b18719 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -16,7 +16,9 @@
  • {{ .Title }}
    -

    {{ .Date.Format ($.Param "time_format_blog") }} {{ T "ui_in"}} {{ .CurrentSection.LinkTitle }}

    +

    + {{- .Date.Format ($.Param "time_format_blog") }} {{ T "ui_in"}} {{ .CurrentSection.LinkTitle -}} +