tpl/data: Make it a package that stands on its own

See #3042
This commit is contained in:
Bjørn Erik Pedersen
2017-04-30 19:11:18 +02:00
parent 0ab23eb5a8
commit 6561557367
3 changed files with 44 additions and 5 deletions

View File

@@ -23,7 +23,6 @@ import (
"github.com/spf13/hugo/deps"
"github.com/spf13/hugo/tpl/collections"
"github.com/spf13/hugo/tpl/crypto"
"github.com/spf13/hugo/tpl/data"
"github.com/spf13/hugo/tpl/encoding"
"github.com/spf13/hugo/tpl/images"
"github.com/spf13/hugo/tpl/inflect"
@@ -42,7 +41,6 @@ type templateFuncster struct {
// Namespaces
collections *collections.Namespace
crypto *crypto.Namespace
data *data.Namespace
encoding *encoding.Namespace
images *images.Namespace
inflect *inflect.Namespace
@@ -63,7 +61,6 @@ func newTemplateFuncster(deps *deps.Deps) *templateFuncster {
// Namespaces
collections: collections.New(deps),
crypto: crypto.New(),
data: data.New(deps),
encoding: encoding.New(),
images: images.New(deps),
inflect: inflect.New(),

View File

@@ -25,6 +25,7 @@ import (
"github.com/spf13/hugo/tpl/internal"
// Init the namespaces
_ "github.com/spf13/hugo/tpl/data"
_ "github.com/spf13/hugo/tpl/lang"
_ "github.com/spf13/hugo/tpl/math"
_ "github.com/spf13/hugo/tpl/strings"
@@ -107,8 +108,6 @@ func (t *templateFuncster) initFuncMap() {
"eq": compare.Eq,
"first": t.collections.First,
"ge": compare.Ge,
"getCSV": t.data.GetCSV,
"getJSON": t.data.GetJSON,
"getenv": t.os.Getenv,
"gt": compare.Gt,
"highlight": t.transform.Highlight,