{{/* 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 }}
{{/* Team Grid */}}
{{ range $block.content.user_groups }} {{ $group_name := . }} {{ $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 "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 }} {{/* Group Header (if multiple groups) */}} {{ if and $query (gt (len $block.content.user_groups) 1) }}

{{ $group_name | markdownify }}

{{ end }} {{/* Team Members */}} {{ range $person := $query }} {{ $avatar := (.Resources.ByType "image").GetMatch "*avatar*" }} {{ $link := "" }} {{ with site.GetPage (printf "/authors/%s" (path.Base .File.Dir)) }} {{ $link = .RelPermalink }} {{ end }}
{{/* Avatar */}} {{ if $avatar }} {{ $image := $avatar.Fill "400x400 Center webp" }} {{ .Title }} {{/* Gradient Overlay */}}
{{ end }} {{/* Content */}}
{{/* Name */}}

{{ .Title }}

{{/* Role & Organization */}} {{ if $show_role }}
{{ with .Params.role }}

{{ . }}

{{ end }} {{ if and $show_organizations .Params.organizations }} {{ range first 1 .Params.organizations }}

{{ .name }}

{{ end }} {{ end }}
{{ end }} {{/* Bio */}} {{ with .Params.bio }}

{{ . }}

{{ end }} {{/* Interests */}} {{ if and $show_interests .Params.interests }}
{{ range first 3 .Params.interests }} {{ . }} {{ end }}
{{ end }} {{/* Social Links */}} {{ if $show_social }}
{{ range .Params.social }} {{ $link := .url | default .link }} {{ $scheme := (urls.Parse $link).Scheme }} {{ $target := "" }} {{ if not $scheme }} {{ $link = (.url | default .link) | relLangURL }} {{ if eq (path.Ext $link) ".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 }}