diff options
Diffstat (limited to 'tpl/resources/resources.go')
-rw-r--r-- | tpl/resources/resources.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tpl/resources/resources.go b/tpl/resources/resources.go index 2adec358c..165152c78 100644 --- a/tpl/resources/resources.go +++ b/tpl/resources/resources.go @@ -111,6 +111,15 @@ func (ns *Namespace) getscssClientDartSass() (*dartsass.Client, error) { return ns.scssClientDartSass, err } +// Copy copies r to the new targetPath in s. +func (ns *Namespace) Copy(s any, r resource.Resource) (resource.Resource, error) { + targetPath, err := cast.ToStringE(s) + if err != nil { + panic(err) + } + return ns.createClient.Copy(r, targetPath) +} + // Get locates the filename given in Hugo's assets filesystem // and creates a Resource object that can be used for further transformations. func (ns *Namespace) Get(filename any) resource.Resource { |