Back to Hugo

resources.Copy

docs/content/en/functions/resources/Copy.md

0.161.1409 B
Original Source
go-html-template
{{ with resources.Get "images/a.jpg" }}
  {{ with resources.Copy "img/new-image-name.jpg" . }}
    
  {{ end }}
{{ end }}

The relative URL of the new published resource will be:

text
/img/new-image-name.jpg

[!note] Use the resources.Copy function with global, page, and remote resources.