mirror of
https://git.sr.ht/~adnano/kiln
synced 2024-11-24 03:01:11 +00:00
Add html function for rendering HTML in templates
This commit is contained in:
parent
13b8bb7ff3
commit
fa19a1746b
|
@ -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