From 86a8e9d0d5934b4148a9df265e79e357ff38d4f5 Mon Sep 17 00:00:00 2001 From: Kodai Okawa Date: Mon, 27 Feb 2023 18:53:17 +0900 Subject: [PATCH] [mod] fix the banner setting --- layouts/partials/sidebar.html | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 3279d60..dc2cca4 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -38,6 +38,36 @@ {{ end }} {{ end }} + + + {{ with $.Site.GetPage $dir }} + {{ range first $maxnum .Pages.ByDate.Reverse }} + {{$StatBanner := and (eq .Params.mkbanner false) (le now .Params.bannerEndDate) }} + {{ if eq $StatBanner true }} + {{ $.Scratch.Set "counter" (add ($.Scratch.Get "counter") 1) }} + {{ if le ($.Scratch.Get "counter") $maxnum }} + {{ if .Params.bannerimg }} +
+ +
+ {{ else if .Params.image }} +
+

{{ .Title }}


+
Posted on {{dateFormat "2 Jan, 2006" .Params.date }}
+
+ + {{ else }} +
+

{{ .Title }}


+
Posted on {{dateFormat "2 Jan, 2006" .Params.date }}
+
+ {{ end }} + {{ end }} + {{ end }} + {{ end }} + {{ end }} + + -- GitLab