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:
parent
04d85b3c63
commit
228862fefa
28 changed files with 922 additions and 624 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue