Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/chipzoller/hugo-clarity.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Boothe <git@rootwork.org>2022-05-11 00:12:06 +0300
committerIvan Boothe <git@rootwork.org>2022-05-11 00:12:06 +0300
commitc8261289c2dab76d0e810cf499d240d145479aaf (patch)
treed3c7688af86d76036ea333cda4a2c000e0d89000 /layouts
parent1e6cff4241b906e0dc9c69b8476977482aad6a72 (diff)
don't print empty figcaption elements
Signed-off-by: Ivan Boothe <git@rootwork.org>
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/figure.html6
1 files changed, 4 insertions, 2 deletions
diff --git a/layouts/partials/figure.html b/layouts/partials/figure.html
index 099a764..5630bc5 100644
--- a/layouts/partials/figure.html
+++ b/layouts/partials/figure.html
@@ -56,8 +56,10 @@
/>
{{/* Provide caption based on image title, if it is set. */}}
- {{- if not (eq $cap " ") -}}
- <figcaption>{{ $cap | safeHTML }}</figcaption>
+ {{- with $cap -}}
+ {{- if not (eq $cap " ") -}}
+ <figcaption>{{ $cap | safeHTML }}</figcaption>
+ {{- end -}}
{{- end -}}
</picture>