{{- $block := .block -}} {{- $block_class := partial "GetBlockClass" .block -}} {{- $image_class := "" -}} {{- with .block.data -}} {{ if .image }} {{- $block_class = printf "%s block-chapter--with-image" $block_class -}} {{- $image_class = printf "image-%s" (partial "GetImageDirection" .image) -}} {{ end }}
{{ partial "blocks/top.html" (dict "title" $block.title "heading_level" $block.ranks.self )}} {{ if (partial "GetTextFromHTML" .text) -}}
{{ partial "PrepareHTML" .text }}
{{ end -}} {{ if (partial "GetTextFromHTML" .notes) }}
{{ partial "PrepareHTML" .notes }}
{{ end -}}
{{ if .image }} {{ partial "commons/image-figure.html" (dict "image" (dict "alt" .alt "id" .image.id "file" .image.file "credit" .credit ) "sizes" site.Params.image_sizes.blocks.chapter ) }} {{ end -}}
{{- end -}}