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