1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-07-02 16:38:37 +00:00

Use SVG sprite for icons

This commit is contained in:
Frédéric Guillot 2021-03-07 11:02:52 -08:00 committed by fguillot
parent b730aa520d
commit f6ed2feab4
11 changed files with 155 additions and 174 deletions

View file

@ -80,6 +80,13 @@ func (f *funcMap) Map() template.FuncMap {
"theme_color": func(theme string) string {
return model.ThemeColor(theme)
},
"icon": func(iconName string) template.HTML {
return template.HTML(fmt.Sprintf(
`<svg class="icon" aria-hidden="true"><use xlink:href="%s#icon-%s"></svg>`,
route.Path(f.router, "appIcon", "filename", "sprite.svg"),
iconName,
))
},
// These functions are overrided at runtime after the parsing.
"elapsed": func(timezone string, t time.Time) string {