{{- $block := .block -}} {{- $template := .block.template -}} {{- $position := .block.position -}} {{- $title := .block.title -}} {{- $charLimit := 80 -}} {{- $isLarge := false -}} {{- with .block.data -}} {{- $with_link := .with_link -}} {{- $with_photo := .with_photo -}} {{ range .persons }} {{- $person := site.GetPage (printf "/persons/%s" .slug) -}} {{- $summary := $person.Params.summary -}} {{- $content := $person.Content -}} {{- $role := .role -}} {{ with (or $role $summary $content)}} {{- $contentLength := len . -}} {{ if ge $contentLength $charLimit }} {{- $isLarge = true -}} {{ end }} {{ end }} {{ end }}
{{ partial "blocks/top.html" (dict "title" $block.title "heading_level" $block.ranks.self "description" .description )}}
{{- range .persons -}} {{ $person := site.GetPage (printf "/persons/%s" .slug) }}
{{- $heading_tag := partial "GetHeadingTag" (dict "level" $block.ranks.children "attributes" "class='name' itemprop='name'" ) -}} {{ $heading_tag.open }} {{ if $with_link }} {{ end }} {{- partial "PrepareHTML" $person.Title -}} {{ if $with_link }} {{ end }} {{ $heading_tag.close }}

{{- if (partial "GetTextFromHTML" .role) }} {{ partial "PrepareHTML" .role }} {{- else if partial "GetTextFromHTML" $person.Params.summary }} {{- partial "PrepareHTML" $person.Params.summary -}} {{ else if (partial "GetTextFromHTML" $person.Content) }} {{- partial "GetTruncateContent" ( dict "text" $person.Content ) -}} {{ end -}}

{{- if $with_photo }}
{{- if $person.Params.image }} {{ partial "commons/image.html" (dict "image" $person.Params.image "sizes" site.Params.image_sizes.blocks.persons ) }} {{ end -}}
{{ end -}}
{{- end -}}
{{- end -}}