Clarify resources.GetRemote 404 handling

This commit is contained in:
Joe Mooring 2024-09-28 16:07:58 -07:00 committed by GitHub
parent 4312d49c91
commit efbee0bff8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -102,6 +102,10 @@ The [`Err`] method on a resource returned by the `resources.GetRemote` function
[`Err`]: /methods/resource/err/
{{% note %}}
Hugo does not classify an HTTP response with status code 404 as an error. In this case the function returns nil.
{{% /note %}}
```go-html-template
{{ $url := "https://broken-example.org/images/a.jpg" }}
{{ with resources.GetRemote $url }}