Use the actual svg instead of feather-sprite.svg for icons

This commit is contained in:
2021-10-09 17:32:35 -05:00
parent c74ce0597c
commit fa3f9b7a51
4 changed files with 10 additions and 6 deletions

View File

@ -1,5 +1,5 @@
{{ $sprites := resources.Get "icon/feather-sprite.svg" | fingerprint "sha256" }}
<svg class="icon" fill="none" stroke="lightgray" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<title>{{ . }} icon</title>
<use href="{{ printf "%s#%s" $sprites.Permalink . | relURL }}" />
</svg>
{{ $icon_resource := resources.Get (printf "feather/icons/%s.svg" .) }}
{{ $icon := $icon_resource.Content }}
{{ $icon = replaceRE `<svg` `<svg class="icon"` $icon }}
{{ $icon = replaceRE `</svg>` `<title>{{ . }} icon</title></svg>` $icon }}
{{ $icon | safeHTML }}