Can I use image processing from an URL in Hugo?

Issue

The hugo documentation allows to use page and global resources to get an image. I was wondering if it’s possible to get an image by an url? Something like this:

{{- $image := resources.Get "https://i.imgur.com/gZxmnyn.jpeg" -}}

Solution

From hugo v0.91.0++ you can use resources.GetRemote

source : https://github.com/gohugoio/hugo/releases/tag/v0.91.0

example:

{{ $image := resources.GetRemote "https://i.imgur.com/gZxmnyn.jpeg" }}

Answered By – Rahmat Fathoni

Answer Checked By – David Marino (GoLangFix Volunteer)

Leave a Reply

Your email address will not be published.