{{- $block := .block -}} {{- $block_class := partial "GetBlockClass" .block -}} {{- $title := .block.title -}} {{- $layout := .block.data.layout | default "grid" -}} {{- with .block.data -}} {{- $show_main_description := .show_main_description -}} {{- $show_descriptions := .show_descriptions -}} {{- $show_images := .show_images -}} {{- $main_description := "" -}} {{- $page_link := false -}} {{- $page_class := "" -}} {{ $page := "" }} {{ with .page }} {{ $page = site.GetPage .file }} {{ end }} {{- with $page }} {{- $page_link = $page.Permalink }} {{ if eq $title "" }} {{ $title = .Title }} {{ end }} {{ if .Params.bodyclass }} {{- $page_class = printf "block-page-%s" .Params.bodyclass }} {{ end }} {{ if $show_main_description }} {{- $main_description = partial "GetTruncateContent" ( dict "text" .Params.summary "length" site.Params.pages.index.truncate_description ) -}} {{ end }} {{ end -}} {{ if $main_description }} {{/* SHOULD BE FIXED WITH ORTHOTYPO */}} {{ $main_description = printf "

%s

" $main_description }} {{ $block_class = printf "%s %s" $block_class "with-description" }} {{ end }} {{ if $show_images }} {{ $block_class = printf "%s %s" $block_class "with-images" }} {{ end }}
{{ partial "blocks/top.html" (dict "title" $title "link" $page_link "heading_level" $block.ranks.self "description" $main_description ) }} {{- partial (printf "blocks/templates/pages/%s.html" $layout) (dict "pages" .pages "heading_level" $block.ranks.children "show_images" $show_images "show_descriptions" $show_descriptions ) }}
{{- end -}}