From e58a540895c28b8884823dcb1b64c272422f9923 Mon Sep 17 00:00:00 2001 From: Bjørn Erik Pedersen Date: Wed, 20 Oct 2021 10:11:48 +0200 Subject: 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 --- hugolib/hugo_sites_build_test.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'hugolib/hugo_sites_build_test.go') 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") -- cgit v1.2.3