{{/* Hugo Blox: Tech Stack */}} {{/* Documentation: https://hugoblox.com/blocks/ */}} {{/* License: https://github.com/HugoBlox/kit/blob/main/LICENSE.md */}} {{/* Initialise */}} {{ $page := .wcPage }} {{ $block := .wcBlock }} {{ $content := $block.content }} {{ if not (reflect.IsMap $content) }}{{ $content = dict }}{{ end }} {{ $design := $block.design }} {{ if not (reflect.IsMap $design) }}{{ $design = dict }}{{ end }} {{/* Enable animations */}} {{ $animations := partial "functions/coerce_bool" (dict "value" (index $design "animations") "default" true) }} {{ if $animations }} {{ $page.Store.Set "has_animations" true }} {{ $page.Store.Set "has_alpine" true }} {{ end }} {{/* Style */}} {{ $style := "grid" }} {{ $style_raw := index $design "style" }} {{ if eq (printf "%T" $style_raw) "string" }} {{ $style_candidate := lower (strings.TrimSpace $style_raw) }} {{ if in (slice "grid" "list") $style_candidate }} {{ $style = $style_candidate }} {{ end }} {{ end }} {{ $show_levels := partial "functions/coerce_bool" (dict "value" (index $design "show_levels") "default" false) }} {{ $title := "" }} {{ $title_raw := index $content "title" }} {{ if $title_raw }}{{ $title = strings.TrimSpace (printf "%v" $title_raw) }}{{ end }} {{ $subtitle := "" }} {{ $subtitle_raw := index $content "subtitle" }} {{ if $subtitle_raw }}{{ $subtitle = strings.TrimSpace (printf "%v" $subtitle_raw) }}{{ end }} {{ $categories_raw := index $content "categories" }} {{ $categories_iter := slice }} {{ if reflect.IsSlice $categories_raw }} {{ $categories_iter = $categories_raw }} {{ else if and $categories_raw (reflect.IsMap $categories_raw) }} {{ $categories_iter = slice $categories_raw }} {{ end }} {{ $categories := slice }} {{ if gt (len $categories_iter) 0 }} {{ range $categories_iter }} {{ if reflect.IsMap . }} {{ $cat_name := "" }} {{ with index . "name" }}{{ $cat_name = strings.TrimSpace (printf "%v" .) }}{{ end }} {{ $items_raw := index . "items" }} {{ $items_iter := slice }} {{ if reflect.IsSlice $items_raw }} {{ $items_iter = $items_raw }} {{ else if and $items_raw (reflect.IsMap $items_raw) }} {{ $items_iter = slice $items_raw }} {{ end }} {{ $items := slice }} {{ if gt (len $items_iter) 0 }} {{ range $items_iter }} {{ if reflect.IsMap . }} {{ $item_name := "" }} {{ $item_icon := "" }} {{ $item_level := "" }} {{ with index . "name" }}{{ $item_name = strings.TrimSpace (printf "%v" .) }}{{ end }} {{ with index . "icon" }}{{ $item_icon = strings.TrimSpace (printf "%v" .) }}{{ end }} {{ with index . "level" }}{{ $item_level = lower (strings.TrimSpace (printf "%v" .)) }}{{ end }} {{ if $item_name }} {{ $items = $items | append (dict "name" $item_name "icon" $item_icon "level" $item_level) }} {{ end }} {{ end }} {{ end }} {{ end }} {{ if gt (len $items) 0 }} {{ $categories = $categories | append (dict "name" $cat_name "items" $items) }} {{ end }} {{ end }} {{ end }} {{ end }}
{{/* Header */}}
{{ with $title }}

{{ . | emojify | $page.RenderString }}

{{ end }} {{ with $subtitle }}

{{ . | emojify | $page.RenderString }}

{{ end }}
{{/* Categories */}} {{ if ne $style "list" }}
{{ range $categories }}
{{/* Category Title */}} {{ with index . "name" }}

{{ . }}

{{ end }} {{/* Tech Items - Centered flex layout */}}
{{ range $idx, $item := (index . "items") }} {{ $level := index $item "level" | default "" }} {{ $level_width := "0%" }} {{ $level_color := "bg-gray-500" }} {{ if eq $level "expert" }} {{ $level_width = "100%" }} {{ $level_color = "bg-emerald-500" }} {{ else if eq $level "advanced" }} {{ $level_width = "75%" }} {{ $level_color = "bg-primary-500" }} {{ else if eq $level "intermediate" }} {{ $level_width = "50%" }} {{ $level_color = "bg-amber-500" }} {{ else if eq $level "beginner" }} {{ $level_width = "25%" }} {{ $level_color = "bg-gray-400" }} {{ end }}
{{/* Icon */}}
{{ with index $item "icon" }} {{/* Add dark-icon class for icons that need inversion in dark mode */}} {{ $dark_icons := slice "express" "vercel" "github" "nextjs" }} {{ $icon_name := . }} {{ $needs_invert := false }} {{ range $dark_icons }} {{ if in $icon_name . }}{{ $needs_invert = true }}{{ end }} {{ end }}
{{ partial "functions/get_icon" (dict "name" . "attributes" "class=\"w-10 h-10\"") }}
{{ end }} {{/* Name */}} {{ index $item "name" }} {{/* Level Indicator */}} {{ if and $show_levels $level }}
{{ $level }}
{{ end }}
{{/* Hover glow effect */}}
{{ end }}
{{ end }}
{{ end }} {{/* Simple flat list style alternative */}} {{ if eq $style "list" }}
{{ range $categories }} {{ range $i, $tech := (index . "items") }}
{{ with index $tech "icon" }} {{ partial "functions/get_icon" (dict "name" . "attributes" "class=\"w-5 h-5\"") }} {{ end }} {{ index $tech "name" }}
{{ end }} {{ end }}
{{ end }}