package main import ( "crypto/x509" "embed" "text/template" "git.sr.ht/~adnano/go-gemini/tofu" ) //go:embed about var static embed.FS var templates *template.Template func init() { funcs := template.FuncMap{ "host": func(hostname string, cert *x509.Certificate) tofu.Host { return tofu.NewHost(hostname, cert.Raw) }, "title": func(err error) string { if title, ok := err.(interface { Title() string }); ok { return title.Title() } return "" }, } templates = template.New("templates").Funcs(funcs) templates = template.Must(templates.ParseFS(static, "about/*.tmpl")) }