mirror of
https://github.com/songquanpeng/message-pusher.git
synced 2025-10-30 03:01:46 +08:00
feat: save messages to database (close #37)
This commit is contained in:
17
common/template.go
Normal file
17
common/template.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"html/template"
|
||||
)
|
||||
|
||||
//go:embed public
|
||||
var FS embed.FS
|
||||
|
||||
func LoadTemplate() *template.Template {
|
||||
var funcMap = template.FuncMap{
|
||||
"unescape": UnescapeHTML,
|
||||
}
|
||||
t := template.Must(template.New("").Funcs(funcMap).ParseFS(FS, "public/*.html"))
|
||||
return t
|
||||
}
|
||||
Reference in New Issue
Block a user