aboutsummaryrefslogtreecommitdiffhomepage
path: root/template/engine.go
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2019-06-01 18:18:09 -0700
committerGravatar fguillot <fred@miniflux.net>2019-06-02 06:30:08 -0700
commit228862fefaa645026caa483ffe9993bf8c00b22e (patch)
tree2b590dc6cda3e50928a31ce673641357805f75ce /template/engine.go
parent04d85b3c63afcf6c9539fc8dc7a91c4e36c2e8fb (diff)
Refactor config package
- Parse configuration only once during startup time - Store configuration values in a global variable
Diffstat (limited to 'template/engine.go')
-rw-r--r--template/engine.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/template/engine.go b/template/engine.go
index e4cdc96..c7f7566 100644
--- a/template/engine.go
+++ b/template/engine.go
@@ -9,7 +9,6 @@ import (
"html/template"
"time"
- "miniflux.app/config"
"miniflux.app/errors"
"miniflux.app/locale"
"miniflux.app/logger"
@@ -78,10 +77,10 @@ func (e *Engine) Render(name, language string, data interface{}) []byte {
}
// NewEngine returns a new template engine.
-func NewEngine(cfg *config.Config, router *mux.Router) *Engine {
+func NewEngine(router *mux.Router) *Engine {
tpl := &Engine{
templates: make(map[string]*template.Template),
- funcMap: newFuncMap(cfg, router),
+ funcMap: &funcMap{router},
}
tpl.parseAll()