- {{ range $idx,$page := .Pages }} - {{ $thisYear := $page.Date.Format ("2006") }} - {{- $lastElement := $idx | add -1 | index $.RegularPages }} - {{- if or (eq $idx 0) ( ne ($lastElement.Date.Format "2006") $thisYear ) }} -
- -
-
-
- {{- if ne $idx 0 }} -
+ {{- $currentYearSection := 0}} + {{- range $idx,$page := .RegularPages}} + {{- $thisYear := $page.Date.Format ("2006") }} + {{- if eq $currentYearSection 0 }} + {{- $currentYearSection = $thisYear}} {{- end }} - {{- end }} - - {{- .Scratch.Set "type" "link"}} - {{- partial "item-post.html" . }} - - {{- end }} -