resources.Copy
Syntax
resources.Copy TARGETPATH RESOURCE
Returns
resource.Resource
{{ with resources.Get "images/a.jpg" }}
{{ with resources.Copy "img/new-image-name.jpg" . }}
<img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
{{ end }}
{{ end }}
新发布的资源的相对URL将为:
/img/new-image-name.jpg
目标路径必须与源路径不同,正如上面的示例所示。