bobatheme/layouts/partials/icon_code.html

7 lines
338 B
HTML
Raw Normal View History

2022-05-02 21:11:38 -05:00
{{- $icon_resource := resources.Get (printf "jam/icons/%s.svg" .) -}}
{{- $icon := $icon_resource.Content -}}
{{- $icon = replaceRE `<svg` `<svg class="icon"` $icon -}}
{{- $icon = replaceRE `</svg>` (printf `<title>%s icon</title></svg>` .) $icon -}}
{{- $icon = replaceRE `(width|height)="[0-9]*"` "" $icon -}}
{{- $icon | safeHTML -}}