aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorTim Keller <tjkeller.xyz>2025-01-13 22:08:27 -0600
committerTim Keller <tjkeller.xyz>2025-01-13 22:08:27 -0600
commit4901b6b3de685532428ff4275481c1f6971e18f1 (patch)
treef58ee0f7434637415855ac9c3bc824cd980afdf6 /layouts
parent675e39fa962b30ee013d1feb0aa148b4ebdd1837 (diff)
downloadhugo-theme-tjkbasic-master.tar.xz
hugo-theme-tjkbasic-master.zip
make images smaller by default and make caption optional on imgs shortcodeHEADmaster
Diffstat (limited to 'layouts')
-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>