From 50d13c4e836ba15f817c4423b54be26f1be21e82 Mon Sep 17 00:00:00 2001 From: Angelo Date: Sat, 26 Dec 2020 16:31:05 +1300 Subject: [PATCH] remove 2100 variable in the solution --- layouts/partials/blog/archive.html | 31 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/layouts/partials/blog/archive.html b/layouts/partials/blog/archive.html index eaba407..fc61331 100644 --- a/layouts/partials/blog/archive.html +++ b/layouts/partials/blog/archive.html @@ -1,18 +1,19 @@
- {{ $prev := 2100}} - {{range .Pages.ByPublishDate.Reverse}} - {{if .Date}} - {{$curr := .Date.Format "2006"}} - {{if gt $prev ($curr)}} -

{{ $curr }}

- {{end}} -
  • - {{ if .Params.date }} - {{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }} - - {{ end }} - {{ .Title | markdownify }} -
  • - {{ $prev = $curr}} + {{ $prev := now.Format "2006"}} +

    {{ $prev }}

    + {{range .Pages.ByPublishDate.Reverse}} + {{if .Date}} + {{$curr := .Date.Format "2006"}} + {{if lt $curr $prev }} +

    {{ $curr }}

    {{end}} - {{end}} +
  • + {{ if .Params.date }} + {{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }} - + {{ end }} + {{ .Title | markdownify }} +
  • + {{ $prev = $curr}} + {{end}} + {{end}}