{{- $block := .block -}} {{- $block_class := partial "GetBlockClass" .block -}} {{- $title := .block.title -}} {{- $layout := .block.data.layout | default "grid" -}} {{- with .block.data -}} {{- $options := .options -}} {{- $main_summary := "" -}} {{- $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-%s" .Params.bodyclass }} {{ end }} {{ if $options.main_summary }} {{- $main_summary = partial "GetTruncateContent" ( dict "text" .Params.summary "length" site.Params.pages.index.truncate_description ) -}} {{ end }} {{ end -}} {{ if $main_summary }} {{/* SHOULD BE FIXED WITH ORTHOTYPO */}} {{ $main_summary = printf "

%s

" $main_summary }} {{ $block_class = printf "%s %s" $block_class "with-description" }} {{ end }} {{ if $options.image }} {{ $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_summary ) }} {{- partial (printf "blocks/templates/pages/%s.html" $layout) (dict "pages" .pages "heading_level" $block.ranks.children "options" $options ) }}
{{- end -}}