Add html function for rendering HTML in templates

This commit is contained in:
Adnan Maolood 2021-05-08 20:28:42 -04:00
parent a58ed86fcd
commit 19852f9e3b

View file

@ -2,6 +2,7 @@ package main
import (
"fmt"
"html/template"
"os"
"path"
"strings"
@ -78,6 +79,9 @@ func (c *Config) LoadTemplates(path string) error {
}
return b.String(), nil
},
"html": func(s string) template.HTML {
return template.HTML(s)
},
})
return c.templates.Load(path)
}