{{- $template := .block.template -}} {{- $position := .block.position -}} {{- $title := .block.title -}} {{- $image_class := "" -}} {{- with .block.data -}} {{- $text := .text -}} {{- $buttons := and .button.text .button_secondary.text -}} {{- if .image -}} {{- $image_class = printf "image-%s" (partial "GetImageDirection" .image ) -}} {{- end -}}
{{- if not $title -}} {{ partial "blocks/default_title.html" $template }} {{ else }}

{{ partial "PrepareHTML" $title }}

{{ end -}} {{- with .image -}}
{{ partial "commons/image.html" (dict "image" . "alt" .alt "sizes" site.Params.image_sizes.blocks.image )}}
{{- if $text }} {{ partial "PrepareHTML" $text }} {{ end -}} {{- if partial "PrepareHTML" .credit }}
{{ partial "PrepareHTML" .credit }}
{{ end -}}
{{- end -}}
{{- end -}}