summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorAditya Telange <21258296+adityatelange@users.noreply.github.com>2020-09-14 17:45:22 +0530
committerAditya Telange <21258296+adityatelange@users.noreply.github.com>2020-09-14 17:45:22 +0530
commitab451ef89ccb489e06a8e7e64b67ae44308db80e (patch)
treeade8b15ff48d498466781e65195fb7937b6fea43 /layouts
parentea94a8bd77fbe4fb24a76ee188bcc58595f1d4eb (diff)
post-cover-image : add support for cover image for post
usage with post params => cover = "<absolute image url>"
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/list.html5
-rw-r--r--layouts/_default/single.html5
2 files changed, 10 insertions, 0 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index ecb3f8d..ae8c367 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -32,6 +32,11 @@
{{- $class = "post-entry tag-entry" }}
{{- end }}
<article class="{{ $class }}">
+ {{ if .Params.cover }}
+ <figure class="entry-cover">
+ <img src="{{ .Params.cover | absURL }}" alt="cover image for {{ .Title }}">
+ </figure>
+ {{ end }}
<header class="entry-header">
<h2>
{{ .Title }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index f1d2407..a10ce57 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -14,6 +14,11 @@
</div>
{{end}}
</header>
+ {{ if .Params.cover }}
+ <figure class="entry-cover">
+ <img src="{{ .Params.cover | absURL }}" alt="cover image for {{ .Title | plainify }}">
+ </figure>
+ {{ end }}
{{ if .Params.ShowToc }}
<div class="toc">
<details>