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