diff --git a/.gitignore b/.gitignore index cc0b434..31402e9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ .env /data -/article -/theme \ No newline at end of file +/article \ No newline at end of file diff --git a/router.go b/router.go index 622a00a..e4605e5 100644 --- a/router.go +++ b/router.go @@ -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) diff --git a/theme_example/statics/css/github-markdown-light.css b/theme/theme_example/statics/css/github-markdown-light.css similarity index 100% rename from theme_example/statics/css/github-markdown-light.css rename to theme/theme_example/statics/css/github-markdown-light.css diff --git a/theme_example/tmpl/article.html b/theme/theme_example/tmpl/article.html similarity index 100% rename from theme_example/tmpl/article.html rename to theme/theme_example/tmpl/article.html diff --git a/theme_example/tmpl/index.html b/theme/theme_example/tmpl/index.html similarity index 100% rename from theme_example/tmpl/index.html rename to theme/theme_example/tmpl/index.html diff --git a/theme_example/tmpl/layouts/base.html b/theme/theme_example/tmpl/layouts/base.html similarity index 100% rename from theme_example/tmpl/layouts/base.html rename to theme/theme_example/tmpl/layouts/base.html