mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-22 21:42:50 +02:00
Add resources.Copy
Implemented by most Resource objects, but not Page (for now). Fixes #9313
This commit is contained in:
@@ -134,7 +134,7 @@ func (i *imageResource) getExif() *exif.ExifInfo {
|
||||
return i.meta.Exif
|
||||
}
|
||||
|
||||
// Cloneis for internal use.
|
||||
// Clone is for internal use.
|
||||
func (i *imageResource) Clone() resource.Resource {
|
||||
gr := i.baseResource.Clone().(baseResource)
|
||||
return &imageResource{
|
||||
@@ -144,6 +144,15 @@ func (i *imageResource) Clone() resource.Resource {
|
||||
}
|
||||
}
|
||||
|
||||
func (i *imageResource) cloneTo(targetPath string) resource.Resource {
|
||||
gr := i.baseResource.cloneTo(targetPath).(baseResource)
|
||||
return &imageResource{
|
||||
root: i.root,
|
||||
Image: i.WithSpec(gr),
|
||||
baseResource: gr,
|
||||
}
|
||||
}
|
||||
|
||||
func (i *imageResource) cloneWithUpdates(u *transformationUpdate) (baseResource, error) {
|
||||
base, err := i.baseResource.cloneWithUpdates(u)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user