From a7092d39904e964eedfc536ab82303a88f3c3505 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Wed, 24 May 2023 02:47:20 +0200 Subject: [PATCH] Gehele figure-tag linken ipv alleen img, anders worden alsnog jpg/png geladen ipv webp --- themes/nluug/layouts/partials/show-image.html | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/themes/nluug/layouts/partials/show-image.html b/themes/nluug/layouts/partials/show-image.html index f930fed..4a11566 100644 --- a/themes/nluug/layouts/partials/show-image.html +++ b/themes/nluug/layouts/partials/show-image.html @@ -1,33 +1,34 @@ +{{ if .link }}{{ end }}
- - {{ $isJPG := eq (path.Ext .image) ".jpg" }} - {{ $isPNG := eq (path.Ext .image) ".png" }} + + {{ $isJPG := eq (path.Ext .image) ".jpg" }} + {{ $isPNG := eq (path.Ext .image) ".png" }} - {{ if ($isJPG) -}} - {{ $webpPath:= replace .image ".jpg" ".webp" }} - {{ $webpPathStatic:= printf "static/%s" $webpPath }} + {{ if ($isJPG) -}} + {{ $webpPath:= replace .image ".jpg" ".webp" }} + {{ $webpPathStatic:= printf "static/%s" $webpPath }} - {{ if (fileExists $webpPathStatic) -}} - + {{ if (fileExists $webpPathStatic) -}} + + {{- end }} {{- end }} - {{- end }} - {{ if ($isPNG) -}} - {{ $webpPath:= replace .image ".png" ".webp" }} - {{ $webpPathStatic:= printf "static/%s" $webpPath }} + {{ if ($isPNG) -}} + {{ $webpPath:= replace .image ".png" ".webp" }} + {{ $webpPathStatic:= printf "static/%s" $webpPath }} - {{ if (fileExists $webpPathStatic) -}} - + {{ if (fileExists $webpPathStatic) -}} + + {{- end }} {{- end }} - {{- end }} - {{ $img := imageConfig (add "/static" (.image | safeURL)) }} - {{ if .link }}{{ end }} - {{ .alt }} - {{ if .link }}{{ end }} - -{{ if .figcaption }} -
-{{ .figcaption }} -
+ {{ $img := imageConfig (add "/static" (.image | safeURL)) }} + + {{ .alt }} + + {{ if .figcaption }} +
+ {{ .figcaption }} +
+ {{ end }}
-{{ end }} +{{ if .link }}{{ end }}