{{- $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 }}