2023-05-21 20:39:56 +00:00
|
|
|
{{ $svg := .path }}
|
2023-05-21 21:05:00 +00:00
|
|
|
{{ $match := `<svg((\s|\S)*)>((\s|\S)*)</svg>` }}
|
2023-05-21 20:39:56 +00:00
|
|
|
|
|
|
|
{{ $replaceWith := printf `<svg class="%s" ${1}>${2}</svg>` .class }}
|
|
|
|
{{ $input := (printf "/assets/images/%s.svg" $svg | readFile) }}
|
|
|
|
{{ return (replaceRE $match $replaceWith $input | safeHTML) }}
|