From 35788daad1538dbc301a130483e3557980f3ef09 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sun, 4 Oct 2020 18:44:13 +0530 Subject: [PATCH] post-cover: add support for adding caption (#17) * shown only on single page usage => in page-vars front-matter cover: image: '' alt: '' caption: '' --- assets/css/post-entry.css | 8 +++++++- layouts/_default/single.html | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/assets/css/post-entry.css b/assets/css/post-entry.css index 42202b47..31f02664 100644 --- a/assets/css/post-entry.css +++ b/assets/css/post-entry.css @@ -88,9 +88,15 @@ font-size: 14px; } +.entry-cover { + margin-bottom: var(--gap); + text-align: center; + font-size: 14px; + color: var(--secondary); +} + .entry-cover img { border-radius: var(--radius); - margin-bottom: var(--gap); pointer-events: none; width: 100%; } diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 7d688e37..5c72ac44 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -33,6 +33,7 @@ {{- else}} {{ .Params.cover.alt | plainify }} {{- end}} +

{{.Params.cover.caption}}

{{- end }} {{- if .Params.ShowToc }}