Debian Codegraph @

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

raw
1 ---
2 title: resources.Copy
3 description: Returns a copy of the given resource at the target path.
4 categories: []
5 params:
6 functions_and_methods:
7 aliases: []
8 returnType: resource.Resource
9 signatures: [resources.Copy TARGETPATH RESOURCE]
10 ---
11
12 {{% include "/_common/methods/resource/global-page-remote-resources.md" %}}
13
14 ```go-html-template
15 {{ with resources.Get "images/a.jpg" }}
16 {{ with resources.Copy "img/new-image-name.jpg" . }}
17 <img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
18 {{ end }}
19 {{ end }}
20 ```
21
22 The `TARGETPATH` is relative to the [site root](g).
23
24 > [!NOTE]
25 > Use the `resources.Copy` function with global, page, and remote resources.