{{ define "content" }} {{ if and .Content (eq .Paginator.PageNumber 1) }}
{{- partial "content.html" (dict "ctx" . "content" .Content) -}}
{{ end }} {{- $group_by_year := .Params.group_by_year | default .Site.Params.list_layout.enable_group_by_year | default true -}} {{- $show_date := .Params.show_date | default .Site.Params.list_layout.enable_show_date | default true -}} {{- $pagination := .Params.pagination | default .Site.Params.list_layout.enable_pagination | default false -}} {{- $pages := .Pages -}} {{- if and $pagination $group_by_year -}} {{ $pages = (.Paginate (.Pages.GroupByPublishDate "2006")).PageGroups }} {{- else if and $pagination (not $group_by_year) -}} {{ $pages = .Paginator.Pages }} {{- else if and (not $pagination) $group_by_year -}} {{ $pages = .Pages.GroupByPublishDate "2006" }} {{- end -}} {{ if $group_by_year }} {{ range $pages }}

{{- .Key -}}

{{- partial "list.html" (dict "pages" .Pages "show_date" $show_date "group_by_year" $group_by_year) -}}
{{ end }} {{ if $pagination }} {{ template "_internal/pagination.html" . }} {{ end }} {{ else }}
{{- partial "list.html" (dict "pages" $pages "show_date" $show_date "group_by_year" $group_by_year) -}}
{{ if $pagination }} {{ template "_internal/pagination.html" . }} {{ end }} {{ end }} {{ end }}