{{ $event := .event }} {{- $direction := "" -}} {{ $heading := .heading | default "h2" }} {{ $heading_tag := (dict "open" ((printf "<%s itemprop='headline'>" $heading) | safeHTML) "close" ((printf "" $heading) | safeHTML) ) }} {{ $index := .index}} {{ $alternate := .alternate}} {{ with $event }} {{ if .Params.image }} {{- $direction = partial "GetImageDirection" .Params.image -}} {{ end }}
{{- $title := partial "PrepareHTML" .Title -}} {{ $heading_tag.open }} {{ $title }} {{ $heading_tag.close }} {{ if site.Params.events.index.show_description }} {{- if (partial "GetTextFromHTML" .Params.summary) -}}

{{ if site.Params.events.index.truncate_description }} {{ partial "GetTruncateContent" ( dict "text" .Params.summary "length" site.Params.events.index.truncate_description ) }} {{ else }} {{ partial "PrepareText" .Params.summary }} {{ end }}

{{- end -}} {{- end -}}
{{ with .Params.dates.from }} {{ .day }} {{ .hour }} {{ end }} {{ with .Params.dates.to }} {{ .day }} {{ .hour }} {{ end }}
{{- if .Params.image -}} {{- partial "commons/image.html" (dict "image" .Params.image "sizes" site.Params.image_sizes.sections.events.item ) -}} {{- else if site.Params.events.default_image -}} {{- partial "commons/image-default.html" -}} {{- end -}}
{{ end }}