{{/* Hugo Blox: Biography */}} {{/* 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 "me" }} {{ $profile := partial "functions/get_author_profile" $author }} {{ $avatar := $profile.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) ) }}