Skip to content

Commit

Permalink
Add some lines about resources.Copy
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed May 31, 2022
1 parent 82cf083 commit 54f3770
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions content/en/hugo-pipes/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 54f3770

Please sign in to comment.