{{/* Hugo Blox: People */}} {{/* Documentation: https://hugoblox.com/blocks/ */}} {{/* License: https://github.com/HugoBlox/hugo-blox-builder/blob/main/LICENSE.md */}} {{/* Initialise */}} {{ $page := .wcPage }} {{ $block := .wcBlock }} {{ $show_social := $block.design.show_social | default false }} {{ $show_interests := $block.design.show_interests | default true }} {{ $show_organizations := $block.design.show_organizations | default false }} {{ $show_role := $block.design.show_role | default true }}
{{ with $block.content.title }}

{{ . | markdownify | emojify }}

{{ with $block.content.subtitle }}

{{ . | markdownify | emojify }}

{{ end }}
{{ end }} {{ with $block.content.text }}
{{ . | emojify | $page.RenderString }}
{{ end }} {{ range $block.content.user_groups }} {{ $query := where (where site.Pages "Section" "authors") ".Params.user_groups" "intersect" (slice .) }} {{/* Sort */}} {{ $sort_by := $block.content.sort_by | default "Params.last_name" }} {{ $sort_by = partial "blox-core/functions/get_sort_by_parameter" $sort_by }} {{ $sort_ascending := $block.content.sort_ascending | default true }} {{ $sort_order := cond $sort_ascending "asc" "desc" }} {{ $query = sort $query $sort_by $sort_order }} {{if $query | and (gt (len $block.content.user_groups) 1) }}

{{ . | markdownify }}

{{end}} {{ range $query }} {{ $avatar := (.Resources.ByType "image").GetMatch "*avatar*" }} {{/* Get link to user's profile page. */}} {{ $link := "" }} {{ with site.GetPage (printf "/authors/%s" (path.Base .File.Dir)) }} {{ $link = .RelPermalink }} {{ end }}
{{ $src := "" }} {{ if site.Params.features.avatar.gravatar }} {{ $src = printf "https://s.gravatar.com/avatar/%s?s=150" (md5 .Params.email) }} {{ else if $avatar }} {{ $avatar_image := $avatar.Fill "270x270 Center" }} {{ $src = $avatar_image.RelPermalink }} {{ end }} {{ if $src }} {{ $avatar_shape := site.Params.features.avatar.shape | default "circle" }} {{with $link}}{{end}}Avatar{{if $link}}{{end}} {{ end }}

{{with $link}}{{end}}{{ .Title }}{{if $link}}{{end}}

{{ if and $show_organizations .Params.organizations }}{{ range .Params.organizations }}

{{ .name }}

{{ end }}{{ end }} {{ if and $show_role .Params.role }}

{{ .Params.role | markdownify | emojify }}

{{ end }} {{ if $show_social }}{{ partial "social_links" . }}{{ end }} {{ if and $show_interests .Params.interests }}

{{ delimit .Params.interests ", " | markdownify | emojify }}

{{ end }}
{{ end }} {{ end }}