{{- /* 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 }}