mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-18 08:43:01 -06:00
move template functions before template loading
This commit is contained in:
parent
89c369f21e
commit
ac1783a697
3 changed files with 13 additions and 15 deletions
|
|
@ -21,3 +21,13 @@ func loadTemplates(cfg *config.Config, engine *gin.Engine) error {
|
|||
engine.LoadHTMLGlob(tmPath)
|
||||
return nil
|
||||
}
|
||||
|
||||
func noescape(str string) template.HTML {
|
||||
return template.HTML(str)
|
||||
}
|
||||
|
||||
func loadTemplateFunctions(engine *gin.Engine) {
|
||||
return r.engine.SetFuncMap(template.FuncMap{
|
||||
"noescape": noescape,
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue