From 609524f4e4213b1dbbb70fb70aa197616f3e8740 Mon Sep 17 00:00:00 2001 From: Timmy Keller Date: Sun, 3 Nov 2024 11:09:06 -0600 Subject: fix spacing around img shortcode --- layouts/shortcodes/img.html | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'layouts') diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html index 65ca44f..56bf22f 100644 --- a/layouts/shortcodes/img.html +++ b/layouts/shortcodes/img.html @@ -1,33 +1,33 @@ - -{{ $image := resources.GetMatch (.Get "src") }} +{{- $image := resources.GetMatch (.Get "src") -}} -{{ $alt := .Get "alt" | default "" }} -{{ $rotation := .Get "rotation" | default 0 }} +{{- $alt := .Get "alt" | 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 }} +{{- $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 -}} -{{ if ne $quality "original" }} - {{ $image = $image.Resize (printf "%dx q%d r%d" $size $q $rotation) }} -{{ end }} +{{- if ne $quality "original" -}} + {{- $image = $image.Resize (printf "%dx q%d r%d" $size $q $rotation) -}} +{{- end -}} +
{{ $alt }}
{{ $alt }}
-- cgit v1.2.3