From e9de4e343d7e17f48a8ec4b1d67de6dd28ae4c47 Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Tue, 28 Jul 2026 00:34:41 -0500 Subject: simplify img shortcode --- layouts/shortcodes/img.html | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html index caf9d75..e2a5db9 100644 --- a/layouts/shortcodes/img.html +++ b/layouts/shortcodes/img.html @@ -5,30 +5,16 @@ {{- $alt := .Get "alt" | default "" -}} {{- $caption := .Get "caption" | default "" -}} -{{- $rotation := .Get "rotation" | default 0 -}} - - -{{- $quality := .Get "quality" | default "original" -}} - - -{{- $q := 0 -}} -{{- $size := 0 -}} -{{- if eq $quality "low" -}} - {{- $q = 60 -}} - {{- $size = 600 -}} -{{- else if eq $quality "medium" -}} - {{- $q = 75 -}} - {{- $size = 1000 -}} -{{- else if eq $quality "high" -}} - {{- $q = 90 -}} - {{- $size = 1200 -}} -{{- end -}} +{{- $rotate := .Get "rotate" | default 0 -}} +{{- $quality := .Get "quality" | default 90 -}} +{{- $size := .Get "size" | default 1200 -}} {{- if ne $quality "original" -}} - {{- $image = $image.Resize (printf "%dx q%d r%d" $size $q $rotation) -}} + {{- $image = $image.Resize (printf "%dx q%d r%d" $size $quality $rotate) -}} {{- end -}} +
{{ $alt }} {{- if ne $caption "" -}} -- cgit v1.2.3