Add html function for rendering HTML in templates

This commit is contained in:
adnano 2021-05-08 20:28:42 -04:00
parent 13b8bb7ff3
commit fa19a1746b

View file

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