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 }} {{ $currentYear = $year }} {{ $currentMonth = 0 }} {{ end }} + {{ if ne $month $currentMonth }} - {{ with $currentMonth }} {{ if ne $currentMonth 0 }} {{ end }} {{ end }} + {{ if ne $currentMonth 0 }} + + {{ end }}