{{/* Hugo Blox: Stats */}} {{/* Documentation: https://hugoblox.com/blocks/ */}} {{/* License: https://github.com/HugoBlox/hugo-blox-builder/blob/main/LICENSE.md */}} {{/* Initialise */}} {{ $page := .wcPage }} {{ $block := .wcBlock }} {{ $title := $block.content.title | emojify | $page.RenderString }} {{ $text := $block.content.text | emojify | $page.RenderString }} {{ $layout := $block.design.layout | default "cards" }}
{{/* Section Header */}} {{ if or $title $text }}
{{ with $title }}

{{ . }}

{{ end }} {{ with $text }}

{{ . }}

{{ end }}
{{ end }} {{/* Cards Layout */}} {{ if eq $layout "cards" }}
{{ range $idx, $item := $block.content.items }}
{{/* Background Gradient */}}
{{/* Icon */}} {{ if $item.icon }}
{{ partial "functions/get_icon" (dict "name" $item.icon "attributes" "class=\"w-8 h-8 text-primary-600 dark:text-primary-400\"") }}
{{ end }} {{/* Statistic */}}

{{ $item.statistic | $page.RenderString }}

{{/* Description */}}

{{ $item.description | $page.RenderString }}

{{/* Optional Sub-metric */}} {{ with $item.sub_metric }}

{{ . }}

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

{{ $item.statistic | $page.RenderString }}

{{ $item.description | $page.RenderString }}

{{ end }}
{{/* Minimal Layout */}} {{ else }}
{{ range $item := $block.content.items }}
{{ if $item.icon }}
{{ partial "functions/get_icon" (dict "name" $item.icon "attributes" "class=\"w-7 h-7 text-primary-600 dark:text-primary-400\"") }}
{{ end }}

{{ $item.statistic | $page.RenderString }}

{{ $item.description | $page.RenderString }}

{{ end }}
{{ end }}
{{/* Enhanced Animation CSS */}} {{/* Animation JavaScript for Counter and Intersection Observer */}}