Browse Source

Fix custom templates being ignored (#4638)

tags/v1.6.0-dev
Piotr Orzechowski Lauris BH 6 years ago
parent
commit
a979efaf6d
1 changed files with 2 additions and 4 deletions
  1. +2
    -4
      modules/templates/static.go

+ 2
- 4
modules/templates/static.go View File

@@ -112,13 +112,11 @@ func NewTemplateFileSystem() templateFileSystem {
return fs return fs
} }


var tplFileSys = NewTemplateFileSystem()

// HTMLRenderer implements the macaron handler for serving HTML templates. // HTMLRenderer implements the macaron handler for serving HTML templates.
func HTMLRenderer() macaron.Handler { func HTMLRenderer() macaron.Handler {
return macaron.Renderer(macaron.RenderOptions{ return macaron.Renderer(macaron.RenderOptions{
Funcs: NewFuncMap(), Funcs: NewFuncMap(),
TemplateFileSystem: tplFileSys,
TemplateFileSystem: NewTemplateFileSystem(),
}) })
} }


@@ -126,7 +124,7 @@ func HTMLRenderer() macaron.Handler {
func JSONRenderer() macaron.Handler { func JSONRenderer() macaron.Handler {
return macaron.Renderer(macaron.RenderOptions{ return macaron.Renderer(macaron.RenderOptions{
Funcs: NewFuncMap(), Funcs: NewFuncMap(),
TemplateFileSystem: tplFileSys,
TemplateFileSystem: NewTemplateFileSystem(),
HTMLContentType: "application/json", HTMLContentType: "application/json",
}) })
} }


Loading…
Cancel
Save