chore: mv asset

This commit is contained in:
henry.chen
2025-07-17 10:57:44 +08:00
parent be0280ac56
commit 4abe528742
58 changed files with 19 additions and 25 deletions

View File

@@ -16,7 +16,7 @@ import (
var xmlTmpl *template.Template
func init() {
root := filepath.Join(config.WorkDir, "website", "template", "*.xml")
root := filepath.Join(config.EtcDir, "template", "*.xml")
var err error
xmlTmpl, err = template.New("").Funcs(template.FuncMap{

View File

@@ -17,17 +17,10 @@ var htmlTmpl *template.Template
func init() {
htmlTmpl = template.New("eiblog").Funcs(tools.TplFuncMap)
root := filepath.Join(config.WorkDir, "website")
root := filepath.Join(config.EtcDir, "website")
files := tools.ReadDirFiles(root, func(fi fs.DirEntry) bool {
name := fi.Name()
if strings.HasPrefix(name, ".") {
return true
}
// should not read template dir
if fi.IsDir() && name == "template" {
return true
}
return false
// should not read dir & .DS_Store
return strings.HasPrefix(fi.Name(), ".") || fi.IsDir()
})
_, err := htmlTmpl.ParseFiles(files...)
if err != nil {