aboutsummaryrefslogtreecommitdiffhomepage
path: root/resources
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-03-07 09:00:44 +0100
committerBjørn Erik Pedersen <[email protected]>2024-03-07 09:50:50 +0100
commita4b17470a81e3c0ac71fd43aef2110336bfe6848 (patch)
tree73fbb6de84b237d72d6485e717457afe319a5552 /resources
parent4d5e173cf82b74c53e3279d75b0243e86ee8bcfc (diff)
downloadhugo-a4b17470a81e3c0ac71fd43aef2110336bfe6848.tar.gz
hugo-a4b17470a81e3c0ac71fd43aef2110336bfe6848.zip
Fix resource name in resources.ByType
Fixes #12190
Diffstat (limited to 'resources')
-rw-r--r--resources/resource_factories/create/create.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/resources/resource_factories/create/create.go b/resources/resource_factories/create/create.go
index ac1a2af07..1ecc4652d 100644
--- a/resources/resource_factories/create/create.go
+++ b/resources/resource_factories/create/create.go
@@ -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