hugo-theme-more-contentful/assets/templates/heroicon.svg
Gabriel Arazas 2f06fd7861 Initial release
All of the changes should be documented in the changelog.
2020-11-03 00:55:18 +08:00

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 }}