diff options
Diffstat (limited to 'lib/templates/template.go')
-rw-r--r-- | lib/templates/template.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/templates/template.go b/lib/templates/template.go index baf7c2cf..28785356 100644 --- a/lib/templates/template.go +++ b/lib/templates/template.go @@ -46,6 +46,10 @@ func ParseTemplateFromFile(templateName string, templateDirs []string, data inte return &body, nil } +func ParseTemplate(name, content string) (*template.Template, error) { + return template.New(name).Funcs(templateFuncs).Parse(content) +} + func CheckTemplate(templateName string, templateDirs []string) error { if templateName != "" { _, err := ParseTemplateFromFile(templateName, templateDirs, DummyData()) |