mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 22:57:55 +00:00
10 lines
393 B
XML
10 lines
393 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>" }}
|
|
{{- $name := default .id .name }}
|
|
{{- $icon := resources.Get (printf "svg/simple-icons/%s.svg" .id) }}
|
|
{{- $replaceWith := printf `<svg id="%s" ${1}>${2}</svg>` $name }}
|
|
|
|
{{- replaceRE $match $replaceWith $icon.Content | safeHTML }}
|