From c9e1e7aa886b47e15881c30e89cbd173c5d290a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=B5=B5=E5=90=8C=E5=AD=A6?= <94612053+imzql@users.noreply.github.com> Date: Thu, 19 Sep 2024 23:22:19 +0800 Subject: [PATCH] Update archives.html --- themes/Ying/layouts/_default/archives.html | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/themes/Ying/layouts/_default/archives.html b/themes/Ying/layouts/_default/archives.html index ad3d52ed..9afb0044 100644 --- a/themes/Ying/layouts/_default/archives.html +++ b/themes/Ying/layouts/_default/archives.html @@ -4,20 +4,25 @@ {{ $currentYear := 0 }} {{ $currentMonth := 0 }} {{ range .Site.RegularPages }} - - {{ if and (eq .Type "post") }} + {{ if eq .Type "post" }} {{ $year := .Date.Year }} {{ $month := .Date.Month }} + {{ if ne $year $currentYear }} - {{ with $currentYear }} {{ if ne $currentYear 0 }} {{ end }} {{ end }} + {{ if ne $currentYear 0 }} + + {{ end }}