diff options
| -rw-r--r-- | main.go | 1 | ||||
| -rw-r--r-- | templates/base/base.gohtml | 5 |
2 files changed, 4 insertions, 2 deletions
@@ -146,6 +146,7 @@ func main() { g.TemplateFuncMap = template.FuncMap{ "getImage": getImage, "getRings": func() []*Ring { return cfg.Rings }, + "getFont": func() string { return cfg.Font }, } host := fmt.Sprintf(":%d", port) diff --git a/templates/base/base.gohtml b/templates/base/base.gohtml index 716b1ca..666e403 100644 --- a/templates/base/base.gohtml +++ b/templates/base/base.gohtml @@ -7,10 +7,11 @@ <link rel="shortcut icon" href="{{getStaticPath "logo.png"}}" type="image/png" /> <title>{{ .Title }}</title> <style> - {{ if ne .Data.Font "" }} + {{ $font := getFont }} + {{ if ne $font "" }} @font-face { font-family: "custom"; - src: url("{{ getStaticPath .Data.Font }}"); + src: url("{{ getStaticPath $font }}"); } body { --fonts: "custom"; |
