From 13a2c8742c3a34ef8d137b78e5209b3d4acb02cc Mon Sep 17 00:00:00 2001 From: Reorx Date: Wed, 7 Sep 2022 02:06:21 +0800 Subject: WIP: newsletter section page and archives page can work --- layouts/_default/archives.html | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'layouts/_default/archives.html') diff --git a/layouts/_default/archives.html b/layouts/_default/archives.html index 966da8a..c2e7aed 100644 --- a/layouts/_default/archives.html +++ b/layouts/_default/archives.html @@ -1,7 +1,7 @@ {{- define "main" }} -{{- $pages := where site.AllPages "Type" "in" site.Params.mainSections }} +{{- $sections := site.Params.mainSections }} +{{/* with the follow condition, archives.html could be used for section archives other than the only one archives of the whole site */}} +{{- if .Section }} + {{- $sections = .Section}} +{{- end }} +{{- $pages := where site.AllPages "Type" "in" $sections }} {{- range $pages.GroupByPublishDate "2006" }} {{- if ne .Key "0001" }} @@ -22,7 +27,6 @@

{{- .Key }}  {{ len .Pages }}

{{- range .Pages }} - {{- if eq .Kind "page" }}

{{- .Title | markdownify }} @@ -34,7 +38,6 @@

{{- end }} - {{- end }}
{{- end }} -- cgit v1.2.3