Skip to content

Commit d095b3b

Browse files
authored
fix: svg-resource not working with vendor aliases (#444)
1 parent c44ba69 commit d095b3b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1-
{{- $path := printf "icons/%s/%s.svg" .vendor .name }}
1+
{{- $vendor := .vendor }}
2+
{{- $name := string .name }}
3+
{{- with index site.Params.icons.vendors $vendor }}
4+
{{- $vendor = .name }}
5+
{{- end }}
6+
{{- $path := printf "icons/%s/%s.svg" $vendor $name }}
27
{{- return (resources.Get $path) -}}

layouts/partials/icons/icon.html

-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
*/}}
1010
{{- $vendor := .vendor }}
1111
{{- $name := string .name }}
12-
{{- with index site.Params.icons.vendors $vendor }}
13-
{{- $vendor = .name }}
14-
{{- end }}
1512
{{- $res := dict "vendor" $vendor "name" $name }}
1613
{{- $icon := partialCached "icons/functions/svg-resource" $res $res -}}
1714
{{- if not $icon -}}

0 commit comments

Comments
 (0)