mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-28 22:19:59 +02:00
Merge commit '346b60358dd8ec2ca228e6635bff9d7914b398b7'
This commit is contained in:
@@ -17,10 +17,10 @@ The `Data` method on a resource returned by the [`resources.GetRemote`] function
|
||||
|
||||
```go-html-template
|
||||
{{ $url := "https://example.org/images/a.jpg" }}
|
||||
{{ with resources.GetRemote $url }}
|
||||
{{ with try (resources.GetRemote $url) }}
|
||||
{{ with .Err }}
|
||||
{{ errorf "%s" . }}
|
||||
{{ else }}
|
||||
{{ else with .Value }}
|
||||
{{ with .Data }}
|
||||
{{ .ContentLength }} → 42764
|
||||
{{ .ContentType }} → image/jpeg
|
||||
@@ -28,9 +28,9 @@ The `Data` method on a resource returned by the [`resources.GetRemote`] function
|
||||
{{ .StatusCode }} → 200
|
||||
{{ .TransferEncoding }} → []
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ errorf "Unable to get remote resource %q" $url }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ errorf "Unable to get remote resource %q" $url }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
@@ -49,5 +49,4 @@ StatusCode
|
||||
TransferEncoding
|
||||
: (`string`) The transfer encoding.
|
||||
|
||||
|
||||
[`resources.GetRemote`]: /functions/resources/getremote/
|
||||
|
Reference in New Issue
Block a user