From 54f377051b9215a2b88e7ab21789cef3b78c1913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 31 May 2022 12:49:28 +0200 Subject: [PATCH] Add some lines about resources.Copy --- content/en/hugo-pipes/introduction.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/content/en/hugo-pipes/introduction.md b/content/en/hugo-pipes/introduction.md index bbafe55b20..11bb4424e8 100755 --- a/content/en/hugo-pipes/introduction.md +++ b/content/en/hugo-pipes/introduction.md @@ -53,6 +53,17 @@ With `resources.GetRemote`, the first argument is a remote URL: `resources.Get` and `resources.GetRemote` return `nil` if the resource is not found. +## Copy a Resource + +{{< new-in "0.100.0" >}} + +`resources.Copy` allows you to copy almost any Hugo `Resource` (the one exception is the `Page`), possibly most useful for renaming things: + +```go-html-template +{{ $resized := $image.Resize "400x400" | resources.Copy "images/mynewname.jpg" } }} + +``` + ### Caching By default, Hugo calculates a cache key based on the `URL` and the `options` (e.g. headers) given.