{{/* Hugo Blox: Research Areas Block */}} {{/* Documentation: https://hugoblox.com/blocks/ */}} {{/* License: https://github.com/HugoBlox/hugo-blox-builder/blob/main/LICENSE.md */}} {{/* Initialise */}} {{ $page := .wcPage }} {{ $block := .wcBlock }} {{ $layout := $block.design.layout | default "cards" }} {{ $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 }}
{{/* Cards Layout */}} {{ if eq $layout "cards" }}
{{ range $idx, $item := $block.content.items }}
{{/* Card Image/Icon Header */}} {{ $header_content := "" }} {{ if $item.image }} {{ $img := resources.Get (printf "media/%s" $item.image) }} {{ if $img }} {{ $img = $img.Fill "600x400 Center webp" }} {{ $header_content = printf "\"%s\"" $img.RelPermalink $item.name }} {{ end }} {{ else if $item.icon }} {{ $icon_html := partial "functions/get_icon" (dict "name" $item.icon "attributes" "class=\"w-24 h-24 text-white/80 group-hover:scale-110 transition-transform duration-300\"") }} {{ $header_content = printf "
%s
" $icon_html }} {{ end }} {{ if and $item.cta.url $header_content }} {{ $header_content | safeHTML }} {{ else }}
{{ $header_content | safeHTML }}
{{ end }} {{/* Status Badge */}} {{ with $item.status }}
{{ . | title }}
{{ end }} {{/* Card Content - Flexible layout */}}
{{/* Main Content */}}

{{ if $item.url }} {{ $item.name }} {{ partial "functions/get_icon" (dict "name" "hero/arrow-top-right-on-square" "attributes" "class=\"inline-block w-4 h-4 ml-1\"") }} {{ else }} {{ $item.name }} {{ end }}

{{ $item.description }}

{{/* Key Topics/Keywords */}} {{ with $item.topics }}
{{ range first 3 . }} {{ . }} {{ end }} {{ if gt (len .) 3 }} +{{ sub (len .) 3 }} more {{ end }}
{{ end }}
{{/* Footer Section - Always at bottom */}}
{{/* Stats/Metrics */}} {{ if or $item.team_size $item.publications $item.funding }}
{{ with $item.team_size }}
{{ partial "functions/get_icon" (dict "name" "hero/user-group" "attributes" "class=\"w-4 h-4 mx-auto mb-1\"") }} {{ . | replaceRE " researchers" "" }} team
{{ end }} {{ with $item.publications }}
{{ partial "functions/get_icon" (dict "name" "hero/document-text" "attributes" "class=\"w-4 h-4 mx-auto mb-1\"") }} {{ . | replaceRE " papers" "" }} papers
{{ end }} {{ with $item.funding }}
{{ partial "functions/get_icon" (dict "name" "hero/currency-dollar" "attributes" "class=\"w-4 h-4 mx-auto mb-1\"") }} {{ . }} funding
{{ end }}
{{ end }} {{/* Call to Action */}} {{ with $item.cta }} {{ .text }} {{ partial "functions/get_icon" (dict "name" "hero/arrow-right" "attributes" "class=\"ml-1 w-4 h-4\"") }} {{ end }}
{{ end }}
{{/* Hexagon Layout */}} {{ else if eq $layout "hexagon" }}
{{ range $idx, $item := $block.content.items }}
{{ if $item.icon }} {{ partial "functions/get_icon" (dict "name" $item.icon "attributes" "class=\"w-12 h-12 text-white mb-3\"") }} {{ end }}

{{ $item.name }}

{{ $item.description | truncate 60 }}

{{ end }}
{{/* Timeline Layout */}} {{ else if eq $layout "timeline" }}
{{/* Vertical Line */}}
{{ range $idx, $item := $block.content.items }}
{{/* Timeline dot */}}
{{ if $item.icon }}
{{ partial "functions/get_icon" (dict "name" $item.icon "attributes" "class=\"w-5 h-5 text-primary-600 dark:text-primary-400\"") }}
{{ end }}

{{ $item.name }}

{{ $item.description }}

{{ end }}
{{ end }} {{/* Global Call to Action */}} {{ with $block.content.cta }} {{ end }}
{{/* Custom CSS for Hexagon Layout */}} {{ if eq $layout "hexagon" }} {{ end }}