{{ define "main" }} {{ $dateFormat := default "Jan 2" (index .Site.Params "date_format") }} {{ $.Scratch.Set "lastYear" ""}}

{{ .Type | humanize}}

{{ range .Pages }} {{ $year := .Date.Year }} {{ $lastYear := $.Scratch.Get "lastYear"}}
{{ if ne $year $lastYear }}

{{ $year }}

{{ $.Scratch.Set "lastYear" $year }} {{ end }} {{ if .Draft }}DRAFT: {{end}}{{ .Title | markdownify }}
{{ end }}
{{ end }}