diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-06-16 07:22:11 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-06-16 07:22:11 +0200 |
commit | 604cfffc5b3903bc4596bf541bf4b970ea478525 (patch) | |
tree | 0e7f7ec4c82b920a8392ac50c7705cd7f3ab0a3a /docs/content/en/hugo-pipes/introduction.md | |
parent | d863dde6c653700fb540d7e4dd6605c7186f59da (diff) | |
parent | 475f87f685439de0f907a9ffc29bfd1361eb1c59 (diff) |
Merge commit '475f87f685439de0f907a9ffc29bfd1361eb1c59'
Diffstat (limited to 'docs/content/en/hugo-pipes/introduction.md')
-rwxr-xr-x | docs/content/en/hugo-pipes/introduction.md | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/content/en/hugo-pipes/introduction.md b/docs/content/en/hugo-pipes/introduction.md index bbafe55b2..a3c956885 100755 --- a/docs/content/en/hugo-pipes/introduction.md +++ b/docs/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" }} +<img src="{{ $resized.RelPermalink }}"> +``` + ### Caching By default, Hugo calculates a cache key based on the `URL` and the `options` (e.g. headers) given. |