1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-06-27 16:36:00 +00:00

Refactor config package

- Parse configuration only once during startup time
- Store configuration values in a global variable
This commit is contained in:
Frédéric Guillot 2019-06-01 18:18:09 -07:00 committed by fguillot
parent 04d85b3c63
commit 228862fefa
28 changed files with 922 additions and 624 deletions

View file

@ -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()