func InitializeRenderers(e *echo.Echo) error { //e.Use(middleware.Logger()) e.Use(middleware.Recover()) e.SetRenderer(&EchoRenderer{}) e.GET("/static*", RenderStatic) return nil }
// Setup theme func Setup(e *echo.Echo, mode string) { var t Template if mode == "dev" { // development t.templates = template.Must(template.ParseGlob("internals/themes/" + Theme + "/*.html")) e.Static("/assets", "internals/themes/"+Theme+"/assets") e.File("/favicon.ico", "internals/themes/"+Theme+"favicon.ico") } else { // production t.templates = template.Must(template.ParseGlob("public/themes/" + Theme + "/*.html")) e.Static("/assets", "public/themes/"+Theme+"/assets") e.File("/favicon.ico", "public/themes/"+Theme+"favicon.ico") } e.SetRenderer(&t) }
func Set(e *echo.Echo, routes []string) *echo.Echo { e.SetRenderer(templates("view", routes)) return e }
func initTemplate(e *echo.Echo, templatePath string) { t := &Template{ templates: template.Must(template.New("").Funcs(registerTemplateFunc()).ParseGlob(templatePath + "/*.html")), } e.SetRenderer(t) }