mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-04-30 20:43:30 +08:00
12 lines
502 B
HTML
12 lines
502 B
HTML
<!-- https://me.micahrl.com/blog/inline-fontawesome-svg-hugo/ -->
|
|
<span
|
|
class="fontawesome-inline-svg"
|
|
style="display:inline-block; height:0.9em; width:0.9em; top:0.1em; position:relative;"
|
|
>
|
|
{{- $fname:=print "themes/hugo-theme-stack/fontawesome/" . ".svg" -}}
|
|
{{- $svg := readFile $fname -}}
|
|
{{- $commentStrippedSvg := replaceRE "<!--[^>]*-->" "" $svg -}}
|
|
{{- $filledPathSvg := replace $commentStrippedSvg "<path" "<path fill='currentColor'" -}}
|
|
{{ $filledPathSvg | safeHTML }}
|
|
</span>
|