1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00

update dependencies

This commit is contained in:
Zack Scholl
2018-07-31 12:40:32 -07:00
parent ff84acd9d7
commit d43cc80b53
738 changed files with 63495 additions and 82870 deletions

View File

@@ -0,0 +1,29 @@
package main
import (
"github.com/gin-contrib/multitemplate"
"github.com/gin-gonic/gin"
)
func createMyRender() multitemplate.Renderer {
r := multitemplate.NewRenderer()
r.AddFromFiles("index", "templates/base.html", "templates/index.html")
r.AddFromFiles("article", "templates/base.html", "templates/index.html", "templates/article.html")
return r
}
func main() {
router := gin.Default()
router.HTMLRender = createMyRender()
router.GET("/", func(c *gin.Context) {
c.HTML(200, "index", gin.H{
"title": "Html5 Template Engine",
})
})
router.GET("/article", func(c *gin.Context) {
c.HTML(200, "article", gin.H{
"title": "Html5 Article Engine",
})
})
router.Run(":8080")
}