Fix resource name in resources.ByType

Fixes #12190
This commit is contained in:
Bjørn Erik Pedersen
2024-03-07 09:00:44 +01:00
parent 4d5e173cf8
commit a4b17470a8
3 changed files with 7 additions and 4 deletions

View File

@@ -128,13 +128,16 @@ func (c *Client) match(name, pattern string, matchFunc func(r resource.Resource)
handle := func(info hugofs.FileMetaInfo) (bool, error) {
meta := info.Meta()
r, err := c.rs.NewResource(resources.ResourceSourceDescriptor{
LazyPublish: true,
OpenReadSeekCloser: func() (hugio.ReadSeekCloser, error) {
return meta.Open()
},
GroupIdentity: meta.PathInfo,
TargetPath: meta.PathInfo.Unnormalized().Path(),
NameNormalized: meta.PathInfo.Name(),
NameOriginal: meta.PathInfo.Unnormalized().Name(),
GroupIdentity: meta.PathInfo,
TargetPath: meta.PathInfo.Unnormalized().Path(),
})
if err != nil {
return true, err