tpl: Add TemplateFuncsNamespaceRegistry

As a first step to remove the hard ties between `tplimpl` and the different namespace packages.

The `lang` package is used as the first example use case.

See #3042
This commit is contained in:
Bjørn Erik Pedersen
2017-04-30 11:34:45 +02:00
parent 8f95172c7a
commit c5373efcf0
6 changed files with 109 additions and 10 deletions

View File

@@ -27,7 +27,6 @@ import (
"github.com/spf13/hugo/tpl/encoding"
"github.com/spf13/hugo/tpl/images"
"github.com/spf13/hugo/tpl/inflect"
"github.com/spf13/hugo/tpl/lang"
"github.com/spf13/hugo/tpl/math"
"github.com/spf13/hugo/tpl/os"
"github.com/spf13/hugo/tpl/safe"
@@ -49,7 +48,6 @@ type templateFuncster struct {
encoding *encoding.Namespace
images *images.Namespace
inflect *inflect.Namespace
lang *lang.Namespace
math *math.Namespace
os *os.Namespace
safe *safe.Namespace
@@ -73,7 +71,6 @@ func newTemplateFuncster(deps *deps.Deps) *templateFuncster {
encoding: encoding.New(),
images: images.New(deps),
inflect: inflect.New(),
lang: lang.New(deps),
math: math.New(),
os: os.New(deps),
safe: safe.New(),