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

This commit is contained in:
BBaoVanC 2021-10-09 17:32:35 -05:00
parent c74ce0597c
commit fa3f9b7a51
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A
4 changed files with 10 additions and 6 deletions

4
.gitmodules vendored Normal file
View File

@ -0,0 +1,4 @@
[submodule "assets/feather"]
path = assets/feather
url = https://github.com/feathericons/feather.git
branch = master

1
assets/feather Submodule

@ -0,0 +1 @@
Subproject commit 734f3f51144e383cfdc6d0916831be8d1ad2a749

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 53 KiB

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 }}