pages-server/render/render.go
hazycora 5c62a8aa17
All checks were successful
Deploy to VPS / build_site (push) Successful in 9s
properly style markdown
2024-04-03 20:09:24 -05:00

28 lines
456 B
Go

package render
import (
"html/template"
"io"
)
var (
templates = template.Must(template.ParseGlob("views/*.tmpl"))
)
type MetaTags struct {
Title string
Description string
Image string
}
func init() {
templates.Funcs(template.FuncMap{
"html": func(s string) template.HTML {
return template.HTML(s)
},
})
}
func Template(writer io.Writer, name string, data any) error {
return templates.ExecuteTemplate(writer, name, data)
}