{{/* Hugo Blox: Biography 3 */}} {{/* Documentation: https://hugoblox.com/blocks/ */}} {{/* License: https://github.com/HugoBlox/hugo-blox-builder/blob/main/LICENSE.md */}} {{/* Initialise */}} {{ $page := .wcPage }} {{ $block := .wcBlock }} {{ $author := $block.content.username | default "admin" }} {{ $person_page_path := (printf "/authors/%s" $author) }} {{ $person_page := site.GetPage $person_page_path }} {{ if not $person_page }} {{ errorf "Could not find an author page at `%s`. Please check the value of `author` in your About widget and create an associated author page if one does not already exist. See https://docs.hugoblox.com/page-builder/#about " $person_page_path }} {{end}} {{ $person := $person_page.Params }} {{ $avatar := ($person_page.Resources.ByType "image").GetMatch "*avatar*" }} {{/* Avatar customization parameters */}} {{ $avatar_size := $block.design.avatar.size | default "medium" }} {{ $avatar_shape := $block.design.avatar.shape | default "circle" }} {{/* Size mappings optimized for 2025 standards: display_size -> [display_px, generation_px] */}} {{ $size_map := dict "small" (slice "150" "300") "medium" (slice "200" "400") "large" (slice "320" "640") "xl" (slice "400" "800") "xxl" (slice "500" "1000") }} {{ $size_config := index $size_map $avatar_size | default (index $size_map "medium") }} {{ $display_size := index $size_config 0 }} {{ $generation_size := index $size_config 1 }} {{/* Shape class mappings */}} {{ $shape_classes := dict "circle" "rounded-full" "square" "rounded-none" "rounded" "rounded-lg" }} {{ $shape_class := index $shape_classes $avatar_shape | default "rounded-full" }}
{{ $img := "" }} {{with $block.design.banner.filename}} {{- $img = resources.Get (path.Join "media" .) -}} {{ if $img }} {{ if ne $img.MediaType.SubType "gif" }} {{ $responsive := partial "functions/process_responsive_image.html" (dict "image" $img "mode" "fill" "aspect_ratio" "16:9" "sizes" (slice 768 1024 1366 1920 2560) ) }}
{{ else }} {{/* Handle GIF without processing */}} {{- $img = $img.Process "webp" -}}
{{ end }} {{ end }} {{ end }}
{{ if $avatar }}
{{ $avatar_image := $avatar.Fill (printf "%sx%s Center" $generation_size $generation_size) }} {{$person_page.Title}} {{with $person.status.icon}}{{.|emojify}}{{end}}
{{ end }}
{{- if $person.name_pronunciation -}} {{ $person_page.Title }} {{ $person.name_pronunciation }} {{- else -}} {{- $person_page.Title -}} {{- end -}}
{{- with $person.pronouns -}}
({{ . }})
{{- end -}} {{ with $person.role }}

{{ . | markdownify | emojify }}

{{ end }} {{ range $person.organizations }}
{{ with .url }}{{ end }}
{{ .name }}
{{ if .url }}
{{ end }}
{{ end }}
    {{ range $person.profiles }} {{ $pack := or .icon_pack "fas" }} {{ $pack_prefix := $pack }} {{ if in (slice "fab" "fas" "far" "fal") $pack }} {{ $pack_prefix = "fa" }} {{ end }} {{ $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" "style=\"height: 1.5rem;\"") }}
  • {{ end }}
{{ with ($block.content.text | emojify | $page.RenderString) | default $person_page.Content }}
{{ . }}
{{ end }} {{ with $block.content.button }} {{.text}} {{ end }}
{{ with $person.interests }}
{{ i18n "interests" | markdownify }}
    {{ range . }}
  • {{ . | markdownify | emojify }}
  • {{ end }}
{{ end }} {{ with $person.education }}
{{ i18n "education" | markdownify }}
    {{ range . }}
  • {{ partial "functions/get_icon" (dict "name" "academic-cap" "attributes" "style=\"\" class='flex-shrink-0 w-5 h-5 me-2 mt-1'") }}

    {{ .area }}{{ with .year }}, {{ . }}{{ end }}

    {{ .institution }}

  • {{ end }}
{{ end }}