aboutsummaryrefslogtreecommitdiff
path: root/internal/template/template.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/template/template.go')
-rw-r--r--internal/template/template.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/internal/template/template.go b/internal/template/template.go
index e31ece2..350a0ed 100644
--- a/internal/template/template.go
+++ b/internal/template/template.go
@@ -3,7 +3,6 @@ package template
import (
"fmt"
"html/template"
- "path/filepath"
"strings"
)
@@ -50,8 +49,7 @@ var funcMap = template.FuncMap{
"byteCount": byteCount,
}
-func ForFile(filename string) *template.Template {
- name := filepath.Base(filename)
+func fromString(name, templateStr string) *template.Template {
tpl := template.New(name).Funcs(funcMap)
- return template.Must(tpl.ParseFiles(filename))
+ return template.Must(tpl.Parse(templateStr))
}