initial
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"embed"
|
||||
"html/template"
|
||||
"io/fs"
|
||||
"log"
|
||||
"path"
|
||||
"strings"
|
||||
)
|
||||
@@ -46,12 +45,10 @@ func loadTemplateDir(
|
||||
|
||||
shareDir := path.Join(dirPath, "share")
|
||||
if _, err := fs.ReadDir(shareDir); err == nil {
|
||||
log.Printf("Parsing %s...", path.Join(shareDir, "*"))
|
||||
t = template.Must(t.ParseFS(fs, path.Join(shareDir, "*")))
|
||||
}
|
||||
|
||||
if data, _ := fs.ReadFile(path.Join(dirPath, "base.html")); data != nil {
|
||||
log.Printf("Parsing %s...", path.Join(dirPath, "base.html"))
|
||||
t = template.Must(t.Parse(string(data)))
|
||||
}
|
||||
|
||||
@@ -72,7 +69,6 @@ func loadTemplateDir(
|
||||
}
|
||||
|
||||
filePath := path.Join(dirPath, ent.Name())
|
||||
log.Printf("Parsing %s...", filePath)
|
||||
|
||||
key := strings.TrimPrefix(path.Join(dirPath, ent.Name()), rootDir)
|
||||
tt := template.Must(t.Clone())
|
||||
|
||||
Reference in New Issue
Block a user