Browse Docs

Functions

Some functions for purposes such as generating SVG files.

Donate

Become a backer or sponsor to support our work.

On this page

Sponsors

icons/functions/svg-resource

The icons/functions/svg-resource function accepts vendor and name parameters and returns the corresponding SVG icon resource. With it, you can generate SVG file instead of inline <svg> element.

1{{ $ctx := dict "vendor" "bootstrap" "name" "house" }}
2{{ with partialCached "icons/functions/svg-resource" $ctx $ctx }}
3  <img src="{{ .RelPermalink }}" />
4{{ end }}