main.go
375 Bytes
package main
import (
"github.com/kataras/iris"
"github.com/kataras/go-template/handlebars"
)
func main() {
config := handlebars.DefaultConfig()
config.Layout = "layouts/layout.hbs"
iris.UseTemplate(handlebars.New(config)).Directory("./templates", ".hbs")
iris.Get("/", func(ctx *iris.Context) {
ctx.Render("test", map[string]interface{} {"Title": "GO"})
})
}