{{- $wcPage := .wcPage -}} {{- $wcBlock := .wcBlock -}} {{- $wcIdentifier := .wcIdentifier -}} {{- $st := $wcBlock.design.spacing | default dict -}} {{- $pad := $st.padding | default (slice "4rem" "0" "4rem" "0") -}}
{{/* Section header */}} {{ if or $wcBlock.content.title $wcBlock.content.subtitle }}
{{ with $wcBlock.content.title }}

{{ . | markdownify }}

{{ end }} {{ with $wcBlock.content.subtitle }}

{{ . | markdownify }}

{{ end }}
{{ end }} {{/* Categories grid - with dynamic counts from Hugo taxonomy */}}
{{ range $wcBlock.content.categories }} {{ $category_name := .category | default .title }} {{/* Get actual count from Hugo taxonomy - proper Hugo syntax */}} {{ $category_url := "" }} {{ $actual_count := 0 }} {{ with site.Taxonomies.categories.Get $category_name }} {{ $actual_count = .Count }} {{ $category_url = .Page.RelPermalink }} {{ end }} {{/* Only show category if it has content OR if count is explicitly set */}} {{ if or (gt $actual_count 0) (.count) }} {{/* Icon */}} {{ with .icon }}
{{ partial "functions/get_icon" (dict "name" .name "attributes" "class=\"h-6 w-6\"") }}
{{ end }} {{/* Title */}}

{{ .title }}

{{/* Description */}} {{ with .description }}

{{ . }}

{{ end }} {{/* Stats - use actual count from taxonomy, fallback to manual count */}}
{{ $display_count := default .count $actual_count }} {{ if $display_count }} {{ $display_count }} {{ cond (eq $display_count 1) (T "article" | default "article") (T "articles" | default "articles") }} {{ end }} {{ T "browse" | default "Browse" }} →
{{/* Hover gradient effect */}}
{{ end }} {{ end }}
{{/* View all link */}} {{ with $wcBlock.content.view_all }} {{ end }}