mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
parent
4d5e173cf8
commit
a4b17470a8
3 changed files with 7 additions and 4 deletions
|
@ -112,6 +112,6 @@ Template: false
|
||||||
Resource1: /js/include.js:END
|
Resource1: /js/include.js:END
|
||||||
Resource2: :END
|
Resource2: :END
|
||||||
Resource3: :END
|
Resource3: :END
|
||||||
Resources: [/js/include.js]
|
Resources: [include.js]
|
||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,11 +128,14 @@ func (c *Client) match(name, pattern string, matchFunc func(r resource.Resource)
|
||||||
|
|
||||||
handle := func(info hugofs.FileMetaInfo) (bool, error) {
|
handle := func(info hugofs.FileMetaInfo) (bool, error) {
|
||||||
meta := info.Meta()
|
meta := info.Meta()
|
||||||
|
|
||||||
r, err := c.rs.NewResource(resources.ResourceSourceDescriptor{
|
r, err := c.rs.NewResource(resources.ResourceSourceDescriptor{
|
||||||
LazyPublish: true,
|
LazyPublish: true,
|
||||||
OpenReadSeekCloser: func() (hugio.ReadSeekCloser, error) {
|
OpenReadSeekCloser: func() (hugio.ReadSeekCloser, error) {
|
||||||
return meta.Open()
|
return meta.Open()
|
||||||
},
|
},
|
||||||
|
NameNormalized: meta.PathInfo.Name(),
|
||||||
|
NameOriginal: meta.PathInfo.Unnormalized().Name(),
|
||||||
GroupIdentity: meta.PathInfo,
|
GroupIdentity: meta.PathInfo,
|
||||||
TargetPath: meta.PathInfo.Unnormalized().Path(),
|
TargetPath: meta.PathInfo.Unnormalized().Path(),
|
||||||
})
|
})
|
||||||
|
|
|
@ -155,6 +155,7 @@ I am a.txt
|
||||||
-- assets/b.txt --
|
-- assets/b.txt --
|
||||||
I am b.txt
|
I am b.txt
|
||||||
-- layouts/index.html --
|
-- layouts/index.html --
|
||||||
|
Home.
|
||||||
{{ with resources.ByType "text" }}
|
{{ with resources.ByType "text" }}
|
||||||
{{ with .Get "a.txt" }}
|
{{ with .Get "a.txt" }}
|
||||||
{{ .Publish }}
|
{{ .Publish }}
|
||||||
|
@ -167,7 +168,6 @@ I am b.txt
|
||||||
|
|
||||||
b := hugolib.Test(t, files)
|
b := hugolib.Test(t, files)
|
||||||
|
|
||||||
b.AssertFileExists("public/index.html", true)
|
|
||||||
b.AssertFileExists("public/a.txt", true) // failing test
|
b.AssertFileExists("public/a.txt", true) // failing test
|
||||||
b.AssertFileExists("public/b.txt", true) // failing test
|
b.AssertFileExists("public/b.txt", true) // failing test
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue