From e943060162dc4a3e91be78a060b0af185476ad7d Mon Sep 17 00:00:00 2001 From: Wang Chucheng Date: Sat, 28 Nov 2020 00:11:11 +0800 Subject: fix: external images in config params --- layouts/partials/get_image.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/layouts/partials/get_image.html b/layouts/partials/get_image.html index 31e833c..59785f2 100644 --- a/layouts/partials/get_image.html +++ b/layouts/partials/get_image.html @@ -7,6 +7,8 @@ {{- end }} {{- if $validKeyword }} {{- $img = ((.context.Resources.ByType "image").GetMatch .keyword).Permalink }} +{{- else if or (hasPrefix .url "//") (or (hasPrefix .url "http://") (hasPrefix .url "https://")) }} +{{- $img = (.url | absURL) }} {{- else if resources.GetMatch .url }} {{- $img = (resources.GetMatch .url).Permalink }} {{- else if .url }} -- cgit v1.2.3