{{ if and .amount .pages }} {{ $amount := .amount }} {{ $type := .type }} {{ $pages := .pages.ByLastmod.Reverse }} {{ $p := .pages.ByLastmod.Reverse }} {{- $paginator := .context.Paginate $pages -}} {{ if .paginate }} {{ $p = $paginator.Pages }} {{ end }} {{ if eq $paginator.PageNumber 1 }} {{ if .content }} {{ partial "snippets/content" (dict "content" .content) }} {{ end }} {{ end }} {{- if gt (len $pages) 0 -}}
{{ if .title }}

{{ .title }}

{{ end }} {{- $home := .context.Kind }} {{- range first $amount $p -}}
{{ $cat := "" }} {{ if .Page.Params.events }} {{ $cat = index .Page.Params.events 0 }} {{ $cat = printf "%s: " $cat }} {{ end }} {{ if eq $type "index" }}

{{ $cat -}}{{- .Title -}}

{{ else }}

{{ $cat -}}{{- .Title -}}

{{ end }}
{{ $px := string "400" }} {{ $fill := string (printf "1280x%s smart" $px) }} {{ $metas := dict "when" .Params.when "price" .Params.price }} {{ $banner := slice }} {{ $image := slice }} {{ $thumb := "" }} {{ if .Resources.GetMatch "banner*" }} {{ $banner = slice (.Resources.GetMatch "banner*") }} {{ end }} {{ if .Resources.ByType "image" }} {{ $image = .Resources.ByType "image" }} {{ end }} {{ $image = (index (complement $banner $image) 0) }} {{ if $banner }} {{ $image = (index $banner 0) }} {{ end }} {{ $image = .Resources.GetMatch (string $image) }} {{ if ne $image nil }} {{ $thumb = $image}} {{ $thumb = $image.Fill $fill }} {{ end }} {{ partial "snippets/article_metadata" $metas }} {{ if $thumb }} {{ end }} {{- if .Content -}}

{{- .Summary -}}

{{ end }}
{{ end }} {{ if .paginate }} {{ partial "snippets/paginator" (dict "paginator" $paginator) }} {{ end }}
{{ end }} {{ end }}