From 4901b6b3de685532428ff4275481c1f6971e18f1 Mon Sep 17 00:00:00 2001
From: Tim Keller <tjkeller.xyz>
Date: Mon, 13 Jan 2025 22:08:27 -0600
Subject: make images smaller by default and make caption optional on imgs
 shortcode

---
 layouts/shortcodes/img.html | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'layouts/shortcodes')

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>
-- 
cgit v1.2.3