diff options
author | Wang Chucheng <wangchucheng@outlook.com> | 2020-11-27 19:11:11 +0300 |
---|---|---|
committer | Wang Chucheng <wangchucheng@outlook.com> | 2020-11-27 19:11:11 +0300 |
commit | e943060162dc4a3e91be78a060b0af185476ad7d (patch) | |
tree | dbf500696ebd216c1363cc03ec54feb7387fa5e7 /layouts | |
parent | 68034e1009a9e9d3ae96d36b4f9f952800c1e7ef (diff) |
fix: external images in config paramsv0.2.1
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/get_image.html | 2 |
1 files changed, 2 insertions, 0 deletions
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 }} |