diff options
author | Bjørn Erik Pedersen <[email protected]> | 2021-10-20 10:11:48 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2022-04-05 18:00:44 +0200 |
commit | e58a540895c28b8884823dcb1b64c272422f9923 (patch) | |
tree | 3fefb267f87e61a969a6ccf776d75fe64b50b2b1 /hugolib/hugo_sites_build_test.go | |
parent | 20162518c450770ebfd54e0e987f34a5cccf236b (diff) | |
download | hugo-e58a540895c28b8884823dcb1b64c272422f9923.tar.gz hugo-e58a540895c28b8884823dcb1b64c272422f9923.zip |
resources: Create a common ResourceFinder interface
And make both .Resources and resources implement it.
This gets us 2 new methods/functions, so you can now also do:
* .Resources.Get
* resources.ByType
Note that GetRemote is not covered by this interface, as that is only available as a global template function.
Fixes #8653
Diffstat (limited to 'hugolib/hugo_sites_build_test.go')
-rw-r--r-- | hugolib/hugo_sites_build_test.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/hugolib/hugo_sites_build_test.go b/hugolib/hugo_sites_build_test.go index cdd7b8054..d71e7c7a4 100644 --- a/hugolib/hugo_sites_build_test.go +++ b/hugolib/hugo_sites_build_test.go @@ -397,6 +397,8 @@ func doTestMultiSitesBuild(t *testing.T, configTemplate, configSuffix string) { c.Assert(bundleFr, qt.Not(qt.IsNil)) c.Assert(len(bundleFr.Resources()), qt.Equals, 1) logoFr := bundleFr.Resources().GetMatch("logo*") + logoFrGet := bundleFr.Resources().Get("logo.png") + c.Assert(logoFrGet, qt.Equals, logoFr) c.Assert(logoFr, qt.Not(qt.IsNil)) b.AssertFileContent("public/fr/bundles/b1/index.html", "Resources: image/png: /blog/fr/bundles/b1/logo.png") b.AssertFileContent("public/fr/bundles/b1/logo.png", "PNG Data") |