package syw import ( "embed" "text/template" ) //go:embed templates/*.gmi var geminiTemplateFS embed.FS var geminiTemplate = template.Must(template.ParseFS(geminiTemplateFS, "templates/*.gmi")) func addTemplates(base *template.Template, additions *template.Template) (*template.Template, error) { base, err := base.Clone() if err != nil { return nil, err } if additions == nil { return base, nil } for _, addition := range additions.Templates() { if _, err := base.AddParseTree(addition.Name(), addition.Tree); err != nil { return nil, err } } return base, nil }