diff options
Diffstat (limited to 'modules/templates/helper.go')
-rw-r--r-- | modules/templates/helper.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go index 741161eb8b..30ca9c1638 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -286,6 +286,9 @@ func NewFuncMap() []template.FuncMap { } return false }, + "svg": func(icon string, size int) template.HTML { + return template.HTML(fmt.Sprintf(`<svg class="svg %s" width="%d" height="%d" aria-hidden="true"><use xlink:href="%s/img/svg/icons.svg#%s" /></svg>`, icon, size, size, setting.StaticURLPrefix, icon)) + }, }} } |