mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
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
This commit is contained in:
@@ -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")
|
||||
|
Reference in New Issue
Block a user