func LayoutAndRenderer() (l Middleware, r Middleware) { tpl, err := template.ParseGlob("templates/*/*.html") if err != nil { panic(err) } l = mangotemplate.MakeLayout(tpl, "main", &provider{}) r = mangotemplate.MakeRenderer(tpl) return }
func NewMux() (r *pat.PatternServeMux) { tpl, err := template.ParseGlob("templates/*/*.html") if err != nil { panic(err) } layout := mangotemplate.MakeLayout(tpl, "main", &provider{}) renderer := mangotemplate.MakeRenderer(tpl) s := new(Stack) s.Middleware(layout, renderer) m := pat.New() m.Get("/", s.HandlerFunc(home.Index)) return m }
func ProduceLayout(name string) Middleware { return mangotemplate.MakeLayout(GetTemplate(), name, &MangoTemplateProvider{}) }