{{- $block := .block -}} {{- $block_class := partial "GetBlockClass" .block -}} {{- $char_limit := 80 -}} {{- $is_large := false -}} {{- with .block.data -}} {{ $layout := .layout | default "grid" }} {{ $options := .options }} {{ $image_sizes := index site.Params.image_sizes.blocks.persons $layout }} {{ range .persons }} {{- $person := site.GetPage .path -}} {{- $role := .role -}} {{- $summary := $person.Params.summary -}} {{- $content := $person.Content -}} {{ with (or $role $summary $content)}} {{- $content_length := len . -}} {{ if ge $content_length $char_limit }} {{- $is_large = true -}} {{ end }} {{ end }} {{ end }} {{ if $is_large }} {{ $block_class = printf "%s block-with-long-text" $block_class }} {{ end }} {{ if not $options.image }} {{ $block_class = printf "%s without-photo" $block_class }} {{ end }}
{{ partial "blocks/top.html" $block.top }} {{ if eq .layout "list" }} {{ partial "blocks/templates/persons/list.html" (dict "options" $options "block" $block )}} {{ else }}
{{- range .persons -}} {{ $person := site.GetPage .path }} {{ partial "persons/person.html" (dict "options" $options "person" $person "role" .role "layout" $layout "image_sizes" $image_sizes )}} {{- end -}}
{{ end }}
{{- end -}}