Skip to content

Commit 58f7dcd

Browse files
committed
fix(biography): make status.icon optional in resume-biography block
Add explicit type checking and proper trimming for status icon extraction to match the more robust pattern used in resume-biography-3. Fixes issue where users couldn't omit the emoji status badge.
1 parent a17fc85 commit 58f7dcd

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

modules/blox/blox/resume-biography-3/block.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
{{ if and $status (reflect.IsMap $status) }}
167167
{{ $status_icon_raw := index $status "icon" }}
168168
{{ if eq (printf "%T" $status_icon_raw) "string" }}
169-
{{ $status_icon = $status_icon_raw }}
169+
{{ $status_icon = strings.TrimSpace $status_icon_raw }}
170170
{{ end }}
171171
{{ end }}
172172

modules/blox/blox/resume-biography/block.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,10 @@
163163
{{ $status_icon := "" }}
164164
{{ with $profile.status }}
165165
{{ if reflect.IsMap . }}
166-
{{ with index . "icon" }}{{ $status_icon = strings.TrimSpace (printf "%v" .) }}{{ end }}
166+
{{ $icon_raw := index . "icon" }}
167+
{{ if eq (printf "%T" $icon_raw) "string" }}
168+
{{ $status_icon = strings.TrimSpace $icon_raw }}
169+
{{ end }}
167170
{{ end }}
168171
{{ end }}
169172

0 commit comments

Comments
 (0)