From 7123e6dfaee51d59064cb4b019c3d6a6ba39105d Mon Sep 17 00:00:00 2001 From: Henk Verlinde Date: Fri, 14 Jan 2022 11:16:45 +0100 Subject: [PATCH] feat: add remote image support --- layouts/_default/_markup/render-image.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index 0c0794f..4a44740 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -1,4 +1,9 @@ -{{ $image := .Page.Resources.GetMatch .Destination -}} +{{ $image := "" -}} +{{ if (urls.Parse .Destination).IsAbs }} + {{ $image = resources.GetRemote .Destination -}} +{{ else -}} + {{ $image = .Page.Resources.GetMatch .Destination -}} +{{ end -}} {{ with $image -}} {{ $lqip := $image.Resize site.Params.lqipWidth -}}