mirror of
https://github.com/foo-dogsquared/hugo-theme-more-contentful.git
synced 2025-01-31 04:58:14 +00:00
9 lines
334 B
XML
9 lines
334 B
XML
{{- /*
|
|
This template applies an ID to an SVG from the Heroicons set to be used with `<use>` element.
|
|
*/ -}}
|
|
{{- $match := "^\\s*<svg (.*)?>" }}
|
|
{{- $icon := resources.Get (printf "svg/heroicons/24/solid/%s.svg" .) }}
|
|
{{- $replaceWith := printf `<svg id="%s" ${1}>` . }}
|
|
|
|
{{- replaceRE $match $replaceWith $icon.Content | safeHTML -}}
|