feat: support custom page

This commit is contained in:
henry.chen
2025-07-17 15:55:32 +08:00
parent 24bfe528b2
commit b69248f6a4
40 changed files with 29 additions and 3 deletions

View File

@@ -39,12 +39,12 @@ func init() {
logrus.Fatal("init timezone: ", err)
}
// 模板解析初始化
root := filepath.Join(config.EtcDir, "template", "*.xml")
root := filepath.Join(config.EtcDir, "xml", "*.xml")
XMLTemplate, err = template.New("eiblog").Funcs(tools.TplFuncMap).ParseGlob(root)
if err != nil {
logrus.Fatal("init xml template: ", err)
}
root = filepath.Join(config.EtcDir, "website")
root = filepath.Join(config.EtcDir, "template")
files := tools.ReadDirFiles(root, func(fi fs.DirEntry) bool {
// should not read dir & .DS_Store
return strings.HasPrefix(fi.Name(), ".")

View File

@@ -42,6 +42,7 @@ func baseFEParams(c *gin.Context) gin.H {
"Disqus": config.Conf.Disqus,
"AdSense": config.Conf.Google.AdSense,
"Version": version,
"Pages": config.Conf.Pages,
}
}