diff options
Diffstat (limited to 'layouts/_default/list.html')
| -rw-r--r-- | layouts/_default/list.html | 6 |
1 files changed, 5 insertions, 1 deletions
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 @@ <article class="{{ $class }}"> {{- if .Params.cover }} <figure class="entry-cover"> - <img src="{{ .Params.cover | absURL }}" alt="cover image for {{ .Title }}"> + {{ 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}} </figure> {{- end }} <header class="entry-header"> |
