Skip to content

Commit 4be6e37

Browse files
committed
Icon: Handle brand icons
1 parent c37dd25 commit 4be6e37

File tree

8 files changed

+15
-1
lines changed

8 files changed

+15
-1
lines changed

layouts/shortcodes/icon.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
{{ partial "lucide" (dict "context" . "icon" (.Get 0)) }}
1+
{{- $iconName := .Get 0 -}}
2+
{{- if or (strings.Contains $iconName "brands") (strings.Contains $iconName "mountain") -}}
3+
{{- $brandSplit := (split $iconName "-") -}}
4+
{{- $brand := delimit (after 1 $brandSplit) "-" -}}
5+
<img src="/images/brands/{{ $brand }}.svg" style="height: 1.5rem; width: 1.5rem;">
6+
{{- else -}}
7+
{{- partial "lucide" (dict "context" . "icon" $iconName) -}}
8+
{{- end -}}

static/images/brands/aws.svg

Lines changed: 1 addition & 0 deletions
Loading

static/images/brands/centos.svg

Lines changed: 1 addition & 0 deletions
Loading

static/images/brands/debian.svg

Lines changed: 1 addition & 0 deletions
Loading

static/images/brands/freebsd.svg

Lines changed: 1 addition & 0 deletions
Loading

static/images/brands/mountain-sun.svg

Lines changed: 1 addition & 0 deletions
Loading

static/images/brands/suse.svg

Lines changed: 1 addition & 0 deletions
Loading

static/images/brands/ubuntu.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)