{{- 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 .Pages.ByDate.Reverse }} {{ if .Params.publication_types }} {{ $.Scratch.Set "pubtype" (index .Params.publication_types 0) }} {{ else }} {{ $.Scratch.Set "pubtype" 0 }} {{ end }}
{{ if eq $.Params.view 1 }} {{ partial "li_list" . }} {{ else if eq $.Params.view 3 }} {{ partial "li_card" . }} {{ else if eq $.Params.view 4 }} {{ partial "li_citation" . }} {{ else }} {{ partial "li_compact" . }} {{ end }}
{{ end }}
{{- end -}}