aboutsummaryrefslogtreecommitdiff
path: root/layouts/shortcodes/img.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/shortcodes/img.html')
-rw-r--r--layouts/shortcodes/img.html5
1 files changed, 4 insertions, 1 deletions
diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html
index 56bf22f..a57e1ed 100644
--- a/layouts/shortcodes/img.html
+++ b/layouts/shortcodes/img.html
@@ -4,6 +4,7 @@
<!-- Get parameters -->
{{- $alt := .Get "alt" | default "" -}}
+{{- $caption := .Get "caption" | default "" -}}
{{- $rotation := .Get "rotation" | default 0 -}}
<!-- Get quality -->
@@ -30,5 +31,7 @@
<figure>
<img src="{{ $image.RelPermalink }}" title="{{ $alt }}" alt="{{ $alt }}" />
- <figcaption>{{ $alt }}</figcaption>
+ {{- if ne $caption "" -}}
+ <figcaption>{{ $caption }}</figcaption>
+ {{- end -}}
</figure>