From 3068647f5877f9f71d0c26d71792da2aa443bac3 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sun, 4 Oct 2020 18:40:39 +0530 Subject: [PATCH] post-cover: use new format usage => in page-vars front-matter cover: image: '' alt: '' --- layouts/_default/list.html | 12 ++++++------ layouts/_default/single.html | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/layouts/_default/list.html b/layouts/_default/list.html index ef3ef296..4a998d3c 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -31,13 +31,13 @@ {{- $class = "post-entry tag-entry" }} {{- end }}
- {{- if .Params.cover }} + {{- if .Params.cover.image }}
- {{ 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}} + {{- if (or (fileExists (path.Join "static" .Params.cover.image)) (hasPrefix .Params.cover.image "http://") (hasPrefix .Params.cover.image "https://")) }} + {{ .Params.cover.alt | plainify }} + {{- else}} + {{ .Params.cover.alt | plainify }} + {{- end}}
{{- end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 7cdea8c9..7d688e37 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -26,13 +26,13 @@ {{- end}}
- {{- if .Params.cover }} + {{- if .Params.cover.image }}
- {{ 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}} + {{- if (or (fileExists (path.Join "static" .Params.cover.image)) (hasPrefix .Params.cover.image "http://") (hasPrefix .Params.cover.image "https://")) }} + {{ .Params.cover.alt | plainify }} + {{- else}} + {{ .Params.cover.alt | plainify }} + {{- end}}
{{- end }} {{- if .Params.ShowToc }}