{{- define "main" -}} {{ partial "page_header.html" . }}
{{ with .Content }}
{{ . }}
{{ end }} {{/* Array of distinct years. */}} {{ range .Pages.ByDate.Reverse }} {{ $year := print (.Date.Format "2006") }} {{ $.Scratch.SetInMap "years" $year $year }} {{ end }}
{{ range $index, $item := .Pages.ByDate.Reverse }} {{ if .Params.publication_types }} {{ $.Scratch.Set "pubtype" (index .Params.publication_types 0) }} {{ else }} {{ $.Scratch.Set "pubtype" 0 }} {{ end }}
{{ partial "functions/render_view" (dict "page" $ "item" . "view" ($.Params.view | default "compact") "index" $index) }}
{{ end }}
{{- end -}}