This commit is contained in:
2023-03-10 16:34:28 +08:00
parent 35aea309f4
commit f61b726ca8
2 changed files with 13 additions and 7 deletions
+9 -3
View File
@@ -40,9 +40,15 @@ func Router() *gin.Engine {
themeName = "theme_example"
}
r.HTMLRender = loadTemplates("./theme/" + themeName + "/tmpl")
r.Static("/statics", "./theme/"+themeName+"/statics")
r.StaticFile("/favicon.ico", "./theme/"+themeName+"/favicon.ico")
themPath := "./theme/" + themeName
if len(os.Getenv("THEME_PATH")) > 0 {
themPath = os.Getenv("THEME_PATH")
}
r.HTMLRender = loadTemplates(themPath + "/tmpl")
r.Static("/statics", themPath+"/statics")
r.StaticFile("/favicon.ico", themPath+"/favicon.ico")
r.GET("/", handler.Index)
r.GET("/article/:id", handler.GetArticle)