summaryrefslogtreecommitdiffstats
path: root/tpl/data
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-11-23 09:16:42 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-11-23 21:09:00 +0100
commitf9b4eb4f3968d32f45e0168c854e6b0c7f3a90b0 (patch)
treebca87a80e39fe35b57fcb36b75fa34e6a1da677a /tpl/data
parente82b2dc8c1628f2da33e5fb0bae1b03e0594ad2c (diff)
Handle themes in the new file cache (for images, assets)
In the newly consolidated file cache implementation, we forgot that we also look in the theme(s) for assets (SCSS transformations etc.), which is not good for Netlify and the demo sites. Fixes #5460
Diffstat (limited to 'tpl/data')
-rw-r--r--tpl/data/resources_test.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/tpl/data/resources_test.go b/tpl/data/resources_test.go
index 4a5482fdb..d1091b23f 100644
--- a/tpl/data/resources_test.go
+++ b/tpl/data/resources_test.go
@@ -23,13 +23,12 @@ import (
"testing"
"time"
- "github.com/gohugoio/hugo/hugolib/paths"
+ "github.com/gohugoio/hugo/helpers"
"github.com/gohugoio/hugo/cache/filecache"
"github.com/gohugoio/hugo/common/loggers"
"github.com/gohugoio/hugo/config"
"github.com/gohugoio/hugo/deps"
- "github.com/gohugoio/hugo/helpers"
"github.com/gohugoio/hugo/hugofs"
"github.com/gohugoio/hugo/langs"
"github.com/spf13/afero"
@@ -181,6 +180,12 @@ func TestScpGetRemoteParallel(t *testing.T) {
func newDeps(cfg config.Provider) *deps.Deps {
cfg.Set("resourceDir", "resources")
+ cfg.Set("dataDir", "resources")
+ cfg.Set("i18nDir", "i18n")
+ cfg.Set("assetDir", "assets")
+ cfg.Set("layoutDir", "layouts")
+ cfg.Set("archetypeDir", "archetypes")
+
l := langs.NewLanguage("en", cfg)
l.Set("i18nDir", "i18n")
cs, err := helpers.NewContentSpec(l)
@@ -190,9 +195,13 @@ func newDeps(cfg config.Provider) *deps.Deps {
fs := hugofs.NewMem(l)
logger := loggers.NewErrorLogger()
- p, _ := paths.New(fs, cfg)
- fileCaches, err := filecache.NewCachesFromPaths(p)
+ p, err := helpers.NewPathSpec(fs, cfg)
+ if err != nil {
+ panic(err)
+ }
+
+ fileCaches, err := filecache.NewCaches(p)
if err != nil {
panic(err)
}