diff options
| author | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2020-10-04 18:40:39 +0530 |
|---|---|---|
| committer | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2020-10-04 18:40:39 +0530 |
| commit | 3068647f5877f9f71d0c26d71792da2aa443bac3 (patch) | |
| tree | 97aba610a056cb9dd9555bf80ca96288fef8b1dc /layouts/_default/list.html | |
| parent | 8cab9c9de52035d85f1ca62bb822d05eb7d4a460 (diff) | |
post-cover: use new format
usage =>
in page-vars front-matter
cover:
image: '<image path/url>'
alt: '<alt text>'
Diffstat (limited to 'layouts/_default/list.html')
| -rw-r--r-- | layouts/_default/list.html | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index ef3ef29..4a998d3 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -31,13 +31,13 @@ {{- $class = "post-entry tag-entry" }} {{- end }} <article class="{{ $class }}"> - {{- if .Params.cover }} + {{- if .Params.cover.image }} <figure class="entry-cover"> - {{ if (or (fileExists (path.Join "static" .Params.cover)) (hasPrefix .Params.cover "http://") (hasPrefix .Params.cover "https://")) }} - <img src="{{ .Params.cover | absURL }}" alt="cover image for {{ .Title | plainify }}"> - {{else}} - <img src="{{ .Permalink -}} {{- .Params.cover }}" alt="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://")) }} + <img src="{{ .Params.cover.image | absURL }}" alt="{{ .Params.cover.alt | plainify }}"> + {{- else}} + <img src="{{ .Permalink -}} {{- .Params.cover.image }}" alt="{{ .Params.cover.alt | plainify }}"> + {{- end}} </figure> {{- end }} <header class="entry-header"> |
