structure example

This commit is contained in:
2022-08-03 22:49:52 +02:00
parent 278302e552
commit 0ec205fe25
11 changed files with 75 additions and 174 deletions

20
html/template.go Normal file
View File

@@ -0,0 +1,20 @@
package html
import (
"html/template"
"strings"
"github.com/russross/blackfriday/v2"
)
func Parse(templates ...string) *template.Template {
return template.Must(template.New("ALL").Funcs(FuncMap()).ParseFiles(templates...))
}
func FuncMap() template.FuncMap {
return template.FuncMap{
"lowercase": strings.ToLower,
"uppercase": strings.ToUpper,
"markdown": blackfriday.Run,
}
}