{{ if and .amount .pages }} {{ $amount := .amount }} {{ $type := .type }} {{ $title := .title }} {{ $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 -}} {{ $px := string "400" }} {{ $fill := string (printf "1280x%s smart" $px) }} {{ $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) }} {{ $banner = (index $banner 0) }} {{ $thumb = $banner.Fill $fill }} {{ $bg_pic := "" }}
{{ $metas := dict "when" .Params.when "price" .Params.price }} {{ $thumb := "" }} {{ $banner := slice }} {{ if (.Resources.GetMatch "banner*") }} {{ if $banner = slice (.Resources.GetMatch "banner*") }} {{ $banner = (index $banner 0) }} {{ $thumb = $banner}} {{ $thumb = $banner.Fill $fill }} {{ $bg_pic = safeCSS (printf "background: url(%s)" $thumb.Permalink) }} {{ end }} {{ end }}
{{ $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 }} {{ partial "snippets/article_metadata" $metas }}
{{- if .Content -}}
{{- .Summary -}}
{{ end }}
{{ end }} {{ if .paginate }} {{ partial "snippets/paginator" (dict "paginator" $paginator) }} {{ end }}
{{ end }} {{ end }}