mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
@@ -47,9 +47,9 @@ func (c *Client) Get(filename string) (resource.Resource, error) {
|
||||
return c.rs.New(resources.ResourceSourceDescriptor{
|
||||
Fs: c.rs.BaseFs.Assets.Fs,
|
||||
LazyPublish: true,
|
||||
SourceFilename: filename})
|
||||
SourceFilename: filename,
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
// Match gets the resources matching the given pattern from the assets filesystem.
|
||||
@@ -93,8 +93,8 @@ func (c *Client) match(pattern string, firstOnly bool) (resource.Resources, erro
|
||||
OpenReadSeekCloser: func() (hugio.ReadSeekCloser, error) {
|
||||
return meta.Open()
|
||||
},
|
||||
RelTargetFilename: meta.Path()})
|
||||
|
||||
RelTargetFilename: meta.Path(),
|
||||
})
|
||||
if err != nil {
|
||||
return true, err
|
||||
}
|
||||
@@ -102,7 +102,6 @@ func (c *Client) match(pattern string, firstOnly bool) (resource.Resources, erro
|
||||
res = append(res, r)
|
||||
|
||||
return firstOnly, nil
|
||||
|
||||
}
|
||||
|
||||
if err := hugofs.Glob(c.rs.BaseFs.Assets.Fs, pattern, handle); err != nil {
|
||||
@@ -110,7 +109,6 @@ func (c *Client) match(pattern string, firstOnly bool) (resource.Resources, erro
|
||||
}
|
||||
|
||||
return res, nil
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
@@ -124,8 +122,7 @@ func (c *Client) FromString(targetPath, content string) (resource.Resource, erro
|
||||
OpenReadSeekCloser: func() (hugio.ReadSeekCloser, error) {
|
||||
return hugio.NewReadSeekerNoOpCloserFromString(content), nil
|
||||
},
|
||||
RelTargetFilename: filepath.Clean(targetPath)})
|
||||
|
||||
RelTargetFilename: filepath.Clean(targetPath),
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user