mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-29 23:20:49 +03:00
tpl: Fix the docshelper
This commit is contained in:
parent
f8446188db
commit
61f210dd7a
2 changed files with 10 additions and 1 deletions
|
@ -14,6 +14,7 @@
|
||||||
package cast
|
package cast
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/gohugoio/hugo/common/loggers"
|
||||||
"github.com/gohugoio/hugo/deps"
|
"github.com/gohugoio/hugo/deps"
|
||||||
"github.com/gohugoio/hugo/docshelper"
|
"github.com/gohugoio/hugo/docshelper"
|
||||||
"github.com/gohugoio/hugo/tpl/internal"
|
"github.com/gohugoio/hugo/tpl/internal"
|
||||||
|
@ -24,7 +25,11 @@ import (
|
||||||
func init() {
|
func init() {
|
||||||
docsProvider := func() map[string]interface{} {
|
docsProvider := func() map[string]interface{} {
|
||||||
docs := make(map[string]interface{})
|
docs := make(map[string]interface{})
|
||||||
d := &deps.Deps{Cfg: viper.New()}
|
d := &deps.Deps{
|
||||||
|
Cfg: viper.New(),
|
||||||
|
Log: loggers.NewErrorLogger(),
|
||||||
|
BuildStartListeners: &deps.Listeners{},
|
||||||
|
}
|
||||||
|
|
||||||
var namespaces internal.TemplateFuncsNamespaces
|
var namespaces internal.TemplateFuncsNamespaces
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,10 @@ import (
|
||||||
|
|
||||||
// New returns a new instance of the resources-namespaced template functions.
|
// New returns a new instance of the resources-namespaced template functions.
|
||||||
func New(deps *deps.Deps) (*Namespace, error) {
|
func New(deps *deps.Deps) (*Namespace, error) {
|
||||||
|
if deps.ResourceSpec == nil {
|
||||||
|
return &Namespace{}, nil
|
||||||
|
}
|
||||||
|
|
||||||
scssClient, err := scss.New(deps.BaseFs.Assets, deps.ResourceSpec)
|
scssClient, err := scss.New(deps.BaseFs.Assets, deps.ResourceSpec)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue