diff --git a/modules/blox/blox/research-areas/README.md b/modules/blox/blox/focus-areas/README.md similarity index 100% rename from modules/blox/blox/research-areas/README.md rename to modules/blox/blox/focus-areas/README.md diff --git a/modules/blox/blox/research-areas/block.html b/modules/blox/blox/focus-areas/block.html similarity index 89% rename from modules/blox/blox/research-areas/block.html rename to modules/blox/blox/focus-areas/block.html index 39fddae6..51108417 100644 --- a/modules/blox/blox/research-areas/block.html +++ b/modules/blox/blox/focus-areas/block.html @@ -99,6 +99,37 @@ {{ with index . "publications" }}{{ $publications = strings.TrimSpace (printf "%v" .) }}{{ end }} {{ with index . "funding" }}{{ $funding = strings.TrimSpace (printf "%v" .) }}{{ end }} + {{/* Generic metrics array: [{ icon, value, label }, ...] — first 3 rendered */}} + {{ $metrics := slice }} + {{ $metrics_raw := index . "metrics" }} + {{ if reflect.IsSlice $metrics_raw }} + {{ range $metrics_raw }} + {{ if reflect.IsMap . }} + {{ $m_icon := "" }} + {{ $m_value := "" }} + {{ $m_label := "" }} + {{ with index . "icon" }}{{ $m_icon = printf "%v" . }}{{ end }} + {{ with index . "value" }}{{ $m_value = strings.TrimSpace (printf "%v" .) }}{{ end }} + {{ with index . "label" }}{{ $m_label = strings.TrimSpace (printf "%v" .) }}{{ end }} + {{ if or $m_value $m_label }} + {{ $metrics = $metrics | append (dict "icon" $m_icon "value" $m_value "label" $m_label) }} + {{ end }} + {{ end }} + {{ end }} + {{ end }} + {{/* Backcompat: synthesise from legacy team_size / publications / funding when `metrics` not provided */}} + {{ if not $metrics }} + {{ if $team_size }} + {{ $metrics = $metrics | append (dict "icon" "hero/user-group" "value" (replaceRE " researchers" "" $team_size) "label" "team") }} + {{ end }} + {{ if $publications }} + {{ $metrics = $metrics | append (dict "icon" "hero/document-text" "value" (replaceRE " papers" "" $publications) "label" "papers") }} + {{ end }} + {{ if $funding }} + {{ $metrics = $metrics | append (dict "icon" "hero/currency-dollar" "value" $funding "label" "funding") }} + {{ end }} + {{ end }} + {{ $cta_raw := index . "cta" }} {{ if reflect.IsMap $cta_raw }} {{ with index $cta_raw "url" }}{{ $cta_url = strings.TrimSpace (printf "%v" .) }}{{ end }} @@ -107,7 +138,7 @@ {{ end }} {{ if or $name $description }} - {{ $items = $items | append (dict "name" $name "description" $description "icon" $icon "image" $image "gradient" $gradient "url" $url "status" $status "topics" $topics "team_size" $team_size "publications" $publications "funding" $funding "cta" (dict "url" $cta_url "text" $cta_text "icon" $cta_icon)) }} + {{ $items = $items | append (dict "name" $name "description" $description "icon" $icon "image" $image "gradient" $gradient "url" $url "status" $status "topics" $topics "metrics" $metrics "team_size" $team_size "publications" $publications "funding" $funding "cta" (dict "url" $cta_url "text" $cta_text "icon" $cta_icon)) }} {{ end }} {{ end }} {{ end }} @@ -158,9 +189,7 @@ {{ $item_url := index $item "url" }} {{ $status := index $item "status" }} {{ $topics := index $item "topics" }} - {{ $team_size := index $item "team_size" }} - {{ $publications := index $item "publications" }} - {{ $funding := index $item "funding" }} + {{ $metrics := index $item "metrics" }} {{ $item_cta := index $item "cta" }} {{ $item_cta_url := "" }} {{ $item_cta_text := "" }} @@ -313,28 +342,16 @@ {{/* Footer Section - Always at bottom */}}
- {{/* Stats/Metrics */}} - {{ if or $team_size $publications $funding }} + {{/* Stats/Metrics — generic icon/value/label, max 3 */}} + {{ with $metrics }}
- {{ with $team_size }} + {{ range first 3 . }}
- {{ partial "functions/get_icon" (dict "name" "hero/user-group" "attributes" "class=\"w-4 h-4 mx-auto mb-1\"") }} - {{ . | replaceRE " researchers" "" }} - team -
- {{ end }} - {{ with $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 $funding }} -
- {{ partial "functions/get_icon" (dict "name" "hero/currency-dollar" "attributes" "class=\"w-4 h-4 mx-auto mb-1\"") }} - {{ . }} - funding + {{ with index . "icon" }} + {{ partial "functions/get_icon" (dict "name" . "attributes" "class=\"w-4 h-4 mx-auto mb-1\"") }} + {{ end }} + {{ with index . "value" }}{{ . }}{{ end }} + {{ with index . "label" }}{{ . }}{{ end }}
{{ end }}
diff --git a/modules/blox/blox/focus-areas/manifest.json b/modules/blox/blox/focus-areas/manifest.json new file mode 100644 index 00000000..fd9ccb36 --- /dev/null +++ b/modules/blox/blox/focus-areas/manifest.json @@ -0,0 +1,13 @@ +{ + "id": "focus-areas", + "name": "Focus Areas", + "version": "1.1.0", + "license": "MIT", + "category": "content", + "tags": ["focus-areas", "topics", "service-areas", "research-areas", "expertise", "pillars", "programs", "showcase"], + "description": "Display focus areas, services, programs, or research themes with rich cards, optional metrics, and multiple layouts (cards, hexagon, timeline)", + "author": "Hugo Blox", + "homepage": "https://hugoblox.com/blocks/", + "repository": "https://github.com/HugoBlox/kit", + "keywords": ["hugo", "static-site", "focus-areas", "service-areas", "research-areas", "topics", "expertise"] +} diff --git a/modules/blox/blox/knowledge-categories/block.html b/modules/blox/blox/help-categories/block.html similarity index 100% rename from modules/blox/blox/knowledge-categories/block.html rename to modules/blox/blox/help-categories/block.html diff --git a/modules/blox/blox/help-categories/manifest.json b/modules/blox/blox/help-categories/manifest.json new file mode 100644 index 00000000..b3d36a17 --- /dev/null +++ b/modules/blox/blox/help-categories/manifest.json @@ -0,0 +1,8 @@ +{ + "name": "help-categories", + "version": "1", + "title": "Help Categories", + "description": "Grid of help center / knowledge base category cards", + "categories": ["content", "navigation"], + "preview": "preview.svg" +} diff --git a/modules/blox/blox/trending-questions/block.html b/modules/blox/blox/help-questions/block.html similarity index 100% rename from modules/blox/blox/trending-questions/block.html rename to modules/blox/blox/help-questions/block.html diff --git a/modules/blox/blox/help-questions/manifest.json b/modules/blox/blox/help-questions/manifest.json new file mode 100644 index 00000000..76aa82d8 --- /dev/null +++ b/modules/blox/blox/help-questions/manifest.json @@ -0,0 +1,8 @@ +{ + "name": "help-questions", + "version": "1", + "title": "Help Questions", + "description": "Display popular, trending, or featured help center questions", + "categories": ["content"], + "preview": "preview.svg" +} diff --git a/modules/blox/blox/knowledge-categories/manifest.json b/modules/blox/blox/knowledge-categories/manifest.json deleted file mode 100644 index f67a38b1..00000000 --- a/modules/blox/blox/knowledge-categories/manifest.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "knowledge-categories", - "version": "1", - "title": "Knowledge Categories", - "description": "Grid of knowledge base category cards", - "categories": ["content", "navigation"], - "preview": "preview.svg" -} diff --git a/modules/blox/blox/research-areas/manifest.json b/modules/blox/blox/research-areas/manifest.json deleted file mode 100644 index f3413af9..00000000 --- a/modules/blox/blox/research-areas/manifest.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "id": "research-areas", - "name": "Research Areas", - "version": "1.0.0", - "license": "MIT", - "category": "content", - "tags": ["research", "areas", "focus", "topics", "science", "lab", "academic", "showcase"], - "description": "Display research focus areas with rich visuals, metrics, and interactive layouts", - "author": "Hugo Blox", - "homepage": "https://hugoblox.com/blocks/", - "repository": "https://github.com/HugoBlox/kit", - "keywords": ["hugo", "static-site", "research", "areas", "academic", "lab", "science"] -} diff --git a/modules/blox/blox/trending-questions/manifest.json b/modules/blox/blox/trending-questions/manifest.json deleted file mode 100644 index dda443e9..00000000 --- a/modules/blox/blox/trending-questions/manifest.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "trending-questions", - "version": "1", - "title": "Trending Questions", - "description": "Display trending or featured questions", - "categories": ["content"], - "preview": "preview.svg" -} diff --git a/modules/blox/data/blox_aliases.yaml b/modules/blox/data/blox_aliases.yaml index b47266bf..594c4338 100644 --- a/modules/blox/data/blox_aliases.yaml +++ b/modules/blox/data/blox_aliases.yaml @@ -9,3 +9,9 @@ renames: new: resume-languages - old: skills new: resume-skills + - old: research-areas + new: focus-areas + - old: knowledge-categories + new: help-categories + - old: trending-questions + new: help-questions