diff --git a/tpl/cast/docshelper.go b/tpl/cast/docshelper.go index 794ede3e3..ef8cc09be 100644 --- a/tpl/cast/docshelper.go +++ b/tpl/cast/docshelper.go @@ -14,6 +14,7 @@ package cast import ( + "github.com/gohugoio/hugo/common/loggers" "github.com/gohugoio/hugo/deps" "github.com/gohugoio/hugo/docshelper" "github.com/gohugoio/hugo/tpl/internal" @@ -24,7 +25,11 @@ import ( func init() { docsProvider := func() 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 diff --git a/tpl/resources/resources.go b/tpl/resources/resources.go index c24cd2b42..8b30f3156 100644 --- a/tpl/resources/resources.go +++ b/tpl/resources/resources.go @@ -34,6 +34,10 @@ import ( // New returns a new instance of the resources-namespaced template functions. func New(deps *deps.Deps) (*Namespace, error) { + if deps.ResourceSpec == nil { + return &Namespace{}, nil + } + scssClient, err := scss.New(deps.BaseFs.Assets, deps.ResourceSpec) if err != nil { return nil, err