good morning!!!!

Skip to content
Snippets Groups Projects
Commit 76053caa authored by a's avatar a
Browse files

templatefile

parent 92ae34f7
Branches
No related tags found
No related merge requests found
......@@ -74,6 +74,16 @@ func (t *Sanctum) FS() afero.Fs {
return t.fs
}
func (t *Sanctum) RegisterTemplateFile(name string) {
bts, err := afero.ReadFile(t.fs, name)
if err != nil {
return
}
sbts := string(bts)
sbts = strings.TrimSuffix(sbts, ".tmpl")
sbts = strings.TrimSuffix(sbts, ".gotmpl")
t.template[name] = sbts
}
func (t *Sanctum) RegisterTemplate(name string, content string) {
t.template[name] = content
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment