Skip to content

Commit

Permalink
fix: svg-resource not working with vendor aliases (#444)
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang authored Oct 28, 2024
1 parent c44ba69 commit d095b3b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 6 additions & 1 deletion layouts/partials/icons/functions/svg-resource.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
{{- $path := printf "icons/%s/%s.svg" .vendor .name }}
{{- $vendor := .vendor }}
{{- $name := string .name }}
{{- with index site.Params.icons.vendors $vendor }}
{{- $vendor = .name }}
{{- end }}
{{- $path := printf "icons/%s/%s.svg" $vendor $name }}
{{- return (resources.Get $path) -}}
3 changes: 0 additions & 3 deletions layouts/partials/icons/icon.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
*/}}
{{- $vendor := .vendor }}
{{- $name := string .name }}
{{- with index site.Params.icons.vendors $vendor }}
{{- $vendor = .name }}
{{- end }}
{{- $res := dict "vendor" $vendor "name" $name }}
{{- $icon := partialCached "icons/functions/svg-resource" $res $res -}}
{{- if not $icon -}}
Expand Down

0 comments on commit d095b3b

Please sign in to comment.