Package plushgin is a plush template renderer that can be used with the Gin web framework. It uses the plush template library.
router.HTMLRender = plushgin.Default()
// or
router.HTMLRender = plushgin.New(plushgin.RenderOptions{
TemplateDir: "templates",
ContentType: "text/html; charset=utf-8",
MaxCacheEnties: 128,
})
router.GET("/", func(c *gin.Context) {
c.HTML(200, "index.html", gin.H{"name": "world"})
})
- layout