From d8199140e5940f02960196d1220c9a0ce8a23de1 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sun, 4 Oct 2020 09:23:27 +0530 Subject: post-cover: add support for relative path for cover image * checks whether path mentioned in `cover` page-variable exists OR is an external url, else sets the relative path for image w.r.t the post the cover is of. --- layouts/_default/list.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'layouts/_default/list.html') diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 2d728e0..ef3ef29 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -33,7 +33,11 @@
{{- if .Params.cover }}
- cover image for {{ .Title }} + {{ if (or (fileExists (path.Join "static" .Params.cover)) (hasPrefix .Params.cover "http://") (hasPrefix .Params.cover "https://")) }} + cover image for {{ .Title | plainify }} + {{else}} + cover image for {{ .Title | plainify }} + {{end}}
{{- end }}
-- cgit v1.2.3