update
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
.env
|
||||
/data
|
||||
/article
|
||||
/theme
|
||||
@@ -35,13 +35,13 @@ func loadTemplates(templatesDir string) multitemplate.Renderer {
|
||||
func Router() *gin.Engine {
|
||||
r := gin.Default()
|
||||
|
||||
themePath := os.Getenv("THEME_PATH")
|
||||
if len(themePath) == 0 {
|
||||
themePath = "./theme_example"
|
||||
themeName := os.Getenv("THEME_NAME")
|
||||
if len(themeName) == 0 {
|
||||
themeName = "theme_example"
|
||||
}
|
||||
|
||||
r.HTMLRender = loadTemplates(themePath + "/tmpl")
|
||||
r.Static("/statics", themePath+"/statics")
|
||||
r.HTMLRender = loadTemplates("./theme/" + themeName + "/tmpl")
|
||||
r.Static("/statics", "./theme/"+themeName+"/statics")
|
||||
|
||||
r.GET("/", handler.Index)
|
||||
r.GET("/article/:id", handler.GetArticle)
|
||||
|
||||
Reference in New Issue
Block a user