From d9c228117bff094eb3545999364a8533f141467d Mon Sep 17 00:00:00 2001 From: Reorx Date: Thu, 8 Sep 2022 00:25:50 +0800 Subject: fix all pages query issues in: list, archives, newsletter section, post_nav_links --- layouts/_default/archives.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'layouts/_default/archives.html') diff --git a/layouts/_default/archives.html b/layouts/_default/archives.html index 285b592..dd53699 100644 --- a/layouts/_default/archives.html +++ b/layouts/_default/archives.html @@ -9,12 +9,13 @@ {{- end }} +{{/* get pages from the current page's section */}} +{{/* in this way, archives.html could be used for section archives other than the only one archives of the whole site */}} {{- $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}} + {{- $sections = slice .Section }} {{- end }} -{{- $pages := where site.AllPages "Type" "in" $sections }} +{{- $pages := where (where site.RegularPages "Section" "in" $sections) "Params.hidden" "!=" true }} {{- range $pages.GroupByPublishDate "2006" }} {{- if ne .Key "0001" }} -- cgit v1.2.3