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