mirror of
https://git.sr.ht/~adnano/kiln
synced 2024-10-30 09:23:09 +00:00
Add html function for rendering HTML in templates
This commit is contained in:
parent
a58ed86fcd
commit
19852f9e3b
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue