Skip to content

Commit 40bd7ec

Browse files
add icon
Signed-off-by: Craig <[email protected]>
1 parent 9d9fc4a commit 40bd7ec

File tree

4 files changed

+33
-7
lines changed

4 files changed

+33
-7
lines changed

assets/icons/dhi.svg

Lines changed: 13 additions & 0 deletions
Loading

content/manuals/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ params:
5151
link: /desktop/
5252
- title: Docker Hardened Images
5353
description: Secure, minimal base images for trusted software delivery.
54-
icon: verified_user
54+
icon: /icons/dhi.svg
5555
link: /dhi/
5656
- title: Build Cloud
5757
description: Build your images faster in the cloud.

layouts/partials/icon.html

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
1-
{{- $svg := resources.Get (fmt.Printf "icons/%s-fill.svg" .) }}
1+
{{- $icon := . -}}
2+
3+
{{- $svgPath := "" -}}
4+
5+
{{- if or (strings.HasSuffix $icon ".svg") (strings.HasPrefix $icon "icons/") }}
6+
{{- $svgPath = $icon -}}
7+
{{- else }}
8+
{{- $svgPath = printf "icons/%s-fill.svg" $icon -}}
9+
{{- end }}
10+
11+
{{- $svg := resources.Get $svgPath -}}
12+
213
{{- if not $svg }}
3-
{{- errorf "Failed to get icon: %v\n\n" . }}
4-
{{ end }}
14+
{{- errorf "Failed to get icon: %v (resolved path: %s)\n\n" $icon $svgPath }}
15+
{{- end }}
16+
517
{{- if not $svg.Content }}
6-
{{- errorf "Failed to get icon: %v\n\n" . }}
18+
{{- errorf "Empty content for icon: %v (resolved path: %s)\n\n" $icon $svgPath }}
719
{{- end }}
8-
{{- safe.HTML $svg.Content -}}
20+
21+
{{- $svg.Content | safeHTML -}}

layouts/shortcodes/summary-bar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"Pro" "person_add"
1111
"Personal" "person"
1212
"Available to all" "public"
13-
"Docker Hardened Images" "security"
13+
"Docker Hardened Images" "/icons/dhi.svg"
1414
}}
1515
{{ $availabilityIcons := dict
1616
"Experimental" "science"

0 commit comments

Comments
 (0)