summaryrefslogtreecommitdiff
path: root/layouts/_default/single.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/_default/single.html')
-rw-r--r--layouts/_default/single.html4
1 files changed, 4 insertions, 0 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index fc95dc6..7cdea8c 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -28,7 +28,11 @@
</header>
{{- if .Params.cover }}
<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}}
</figure>
{{- end }}
{{- if .Params.ShowToc }}