{{/* Hugo Blox: Team Showcase */}} {{/* 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 true }} {{ $show_interests := $block.design.show_interests | default false }} {{ $show_role := $block.design.show_role | default true }} {{ $show_organizations := $block.design.show_organizations | default false }} {{ $title := $block.content.title | emojify | $page.RenderString }} {{ $subtitle := $block.content.subtitle | emojify | $page.RenderString }} {{ $text := $block.content.text | emojify | $page.RenderString }}
{{/* Section Header */}}
{{ with $title }}

{{ . }}

{{ end }} {{ with $subtitle }}

{{ . }}

{{ end }} {{ with $text }}
{{ . }}
{{ end }}
{{/* Build profiles from data/authors */}} {{ $allProfiles := slice }} {{ range $slug, $_ := site.Data.authors }} {{ $allProfiles = $allProfiles | append (partial "functions/get_author_profile" (dict "slug" $slug)) }} {{ end }} {{ $groups := $block.content.user_groups }} {{ if $groups }} {{ range $group := $groups }} {{ $groupProfiles := slice }} {{ range $allProfiles }} {{ $u := .user_groups | default (slice) }} {{ if gt (len (intersect $u (slice $group))) 0 }} {{ $groupProfiles = $groupProfiles | append . }} {{ end }} {{ end }} {{ $groupProfiles = sort $groupProfiles "title" }} {{ if and $groupProfiles (gt (len $groups) 1) }}

{{ $group | markdownify }}

{{ end }}
{{ range $profile := $groupProfiles }} {{ $avatar := $profile.avatar }} {{ $link := printf "/authors/%s/" $profile.slug }}
{{ if $avatar }} {{ $image := $avatar.Fill "400x400 Center webp" }} {{ $profile.title }}
{{ end }}

{{ $profile.title }}

{{ if $show_role }}
{{ with $profile.role }}

{{ . }}

{{ end }} {{ if and $show_organizations $profile.affiliations }} {{ range first 1 $profile.affiliations }}

{{ .name }}

{{ end }} {{ end }}
{{ end }} {{ with $profile.bio }}

{{ . }}

{{ end }} {{ if and $show_interests $profile.interests }}
{{ range first 3 $profile.interests }} {{ . }} {{ end }}
{{ end }} {{ if and $show_social $profile.links }}
{{ range $profile.links }} {{ $l := .url | default .link }} {{ $scheme := (urls.Parse $l).Scheme }} {{ $target := "" }} {{ if not $scheme }} {{ $l = (.url | default .link) | relLangURL }} {{ if eq (path.Ext $l) ".pdf" }}{{ $target = "target=\"_blank\" rel=\"noopener\"" }}{{ end }} {{ else if in (slice "http" "https") $scheme }} {{ $target = "target=\"_blank\" rel=\"noopener\"" }} {{ end }} {{ partial "functions/get_icon" (dict "name" .icon "attributes" "class=\"w-5 h-5\"") }} {{ end }}
{{ end }}
{{ end }}
{{ end }} {{ else }} {{ $allProfiles = sort $allProfiles "title" }}
{{ range $profile := $allProfiles }} {{ $avatar := $profile.avatar }} {{ $link := printf "/authors/%s/" $profile.slug }}
{{ if $avatar }} {{ $image := $avatar.Fill "400x400 Center webp" }} {{ $profile.title }}
{{ end }}

{{ $profile.title }}

{{ if $show_role }}
{{ with $profile.role }}

{{ . }}

{{ end }} {{ if and $show_organizations $profile.affiliations }} {{ range first 1 $profile.affiliations }}

{{ .name }}

{{ end }} {{ end }}
{{ end }} {{ with $profile.bio }}

{{ . }}

{{ end }} {{ if and $show_interests $profile.interests }}
{{ range first 3 $profile.interests }} {{ . }} {{ end }}
{{ end }} {{ if and $show_social $profile.links }}
{{ range $profile.links }} {{ $l := .url | default .link }} {{ $scheme := (urls.Parse $l).Scheme }} {{ $target := "" }} {{ if not $scheme }} {{ $l = (.url | default .link) | relLangURL }} {{ if eq (path.Ext $l) ".pdf" }}{{ $target = "target=\"_blank\" rel=\"noopener\"" }}{{ end }} {{ else if in (slice "http" "https") $scheme }} {{ $target = "target=\"_blank\" rel=\"noopener\"" }} {{ end }} {{ partial "functions/get_icon" (dict "name" .icon "attributes" "class=\"w-5 h-5\"") }} {{ end }}
{{ end }}
{{ end }}
{{ end }} {{/* Call to Action */}} {{ with $block.content.cta }}
{{ .text }} {{ with .icon }} {{ partial "functions/get_icon" (dict "name" . "attributes" "class=\"ml-2 w-5 h-5\"") }} {{ end }}
{{ end }}