Move template files to specific folder

Signed-off-by: Yuan Si <do4suki@gmail.com>
This commit is contained in:
2023-04-26 01:52:05 +08:00
parent 327b4a222b
commit 75856025b4
5 changed files with 293 additions and 287 deletions
+2 -2
View File
@@ -18,7 +18,7 @@ func main() {
// Router
r := gin.Default()
r.Static("/static", "static")
r.LoadHTMLGlob("static/*.tmpl")
r.LoadHTMLGlob("static/templates/**/*.html")
// /
r.Any("/", func(ctx *gin.Context) {
@@ -99,7 +99,7 @@ func main() {
// Web
// Manga
r.GET("/manga", func(ctx *gin.Context) {
ctx.HTML(http.StatusOK, "manga.tmpl", gin.H{})
ctx.HTML(http.StatusOK, "common/manga.html", gin.H{})
})
r.Run(":80") // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")