Understanding .GetRemote

That’s two things, that’s why the docs are not clear on this. They are clear on each of these things but not both together. I remembered there was a post about how to achieve that and I knew it would come back and have some notes. Have a look and see if that helps you.

{{ $img := resources.GetRemote "REMOTE_URL_TO_IMAGE" }}
{{ $img := $img.Content | resources.FromString "images/FILENAME.EXT" }}
<img src="{{ $img.RelPermalink }}">

via and via

Edit: I just remembered, that “my” solution is for adding the remote resource under a path/link that you wish to define by yourself. Bep’s solution in the next answer is better if you don’t care about that detail.

2 Likes