From bb02a60990dd79f9828798a044776984d51ff5da Mon Sep 17 00:00:00 2001 From: Reorx Date: Thu, 8 Sep 2022 21:55:35 +0800 Subject: [PATCH] newsletter section: only show list when there are pages --- layouts/newsletter/section.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/layouts/newsletter/section.html b/layouts/newsletter/section.html index 28ac710..04c3eed 100644 --- a/layouts/newsletter/section.html +++ b/layouts/newsletter/section.html @@ -12,10 +12,12 @@ {{- partial "newsletter_sub_form.html"}} -

最近更新

+ {{ $pages := where .Pages "Params.hidden" "!=" true }} + {{ if $pages }} +

最新通讯

- {{- range first 5 (where .Pages "Params.hidden" "!=" true) }} + {{- range first 5 $pages }}
{{- if not .Date.IsZero -}} @@ -32,6 +34,7 @@
{{- end }}
+ {{ end }}

相关链接