{{ $svg := .path }} {{ $match := `((\s|\S)*)` }} {{ $replaceWith := printf `${2}` .class }} {{ $input := (printf "/assets/images/%s.svg" $svg | readFile) }} {{ return (replaceRE $match $replaceWith $input | safeHTML) }}