resources.Copy
Returns a copy of the given resource at the target path.
- Syntax
- resources.Copy TARGETPATH RESOURCE
- Returns
- resource.Resource
Use this method with global resources, page resources, or remote resources.
{{ with resources.Get "images/a.jpg" }}
{{ with resources.Copy "img/new-image-name.jpg" . }}
<img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
{{ end }}
{{ end }}The TARGETPATH is relative to the site root.
Use the resources.Copy function with global, page, and remote resources.
Last updated:
September 11, 2026
:
content: Comply with function/method description guidance in style guide (76fa3fc9e)
Improve this page