tw-runner
Version:
Run and manage Tower Website projects with this utility.
18 lines (14 loc) • 667 B
HTML
{{ $image := resources.Get .src }}
{{ $processedImage := $image | fingerprint }}
{{ $width := default "20px" .width }}
{{ $height := default "20px" .height }}
{{ $viewBox := default "0 0 200 200" .viewBox }}
{{ $class := default "" .class }}
{{ $alt := default "" .alt }}
{{ $svgContent := $processedImage.Content | safeHTML }}
{{ $svgContent = replace $svgContent "<svg>" "" }}
{{ $svgContent = replace $svgContent "</svg>" "" }}
{{ $svgContent = $svgContent | safeHTML }}
<svg class="{{ .class }}" alt="{{ .alt }}" width="{{ $width }}" height="{{ $height }}" viewBox="{{ $viewBox }}">
{{ $svgContent }}
</svg>