diff options
author | Sascha Wolf <swolf.dev@gmail.com> | 2019-03-18 22:15:15 +0300 |
---|---|---|
committer | Sascha Wolf <swolf.dev@gmail.com> | 2019-03-18 23:44:22 +0300 |
commit | 85650141a792543c9d8f98de4f460a7c5095603c (patch) | |
tree | 4326bdcd544afaa9736b374bbbada7ec292d5be7 /layouts/_default/summary.html | |
parent | c7d2fdee5d258d95089e0ee73333f37e6e823e0d (diff) |
Summary: Handle relative URLs properly for thumbnail generation
Diffstat (limited to 'layouts/_default/summary.html')
-rw-r--r-- | layouts/_default/summary.html | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index d880744..01cf7a4 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -10,8 +10,12 @@ {{ end }} {{ end }} {{ else }} - {{ if .Params.coverimage }} - {{ .Scratch.Set "thumbnailImage" (.Params.coverimage | absURL) }} + {{ if .Params.coverImage }} + {{ if (findRE "^/" .Params.coverImage 1) }} + {{ .Scratch.Set "thumbnailImage" (.Params.coverImage | absURL) }} + {{ else }} + {{ .Scratch.Set "thumbnailImage" (path.Join .RelPermalink .Params.coverImage) }} + {{ end }} {{ end }} {{ end }} {{ end }} |