From 76ff776d7bcbf4d24a924bfcea9125c233f4f21b Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Sun, 21 May 2023 11:51:25 +0200 Subject: [PATCH] Fix images in 3d post --- .../index.md | 4 ++-- layouts/shortcodes/img.html | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/content/posts/designing-and-3d-printing-a-wall-mount-for-my-isp-modem/index.md b/content/posts/designing-and-3d-printing-a-wall-mount-for-my-isp-modem/index.md index e00d29e..ba9e608 100644 --- a/content/posts/designing-and-3d-printing-a-wall-mount-for-my-isp-modem/index.md +++ b/content/posts/designing-and-3d-printing-a-wall-mount-for-my-isp-modem/index.md @@ -56,9 +56,9 @@ I was a bit worried about the resistance for the bottom pieces but they seem to Here's what it looks like once mounted and plugged: -{{< img src="6.jpeg" alt="Large view of my closet with the modem mounted on the wall" >}} +{{< img src="6.jpeg" resizeAdd="r270" alt="Large view of my closet with the modem mounted on the wall" >}} -{{< img src="5.jpeg" alt="Close view of my closet with the modem mounted on the wall" >}} +{{< img src="5.jpeg" resizeAdd="r270" alt="Close view of my closet with the modem mounted on the wall" >}} I'm quite proud of this since it's one of my first "hardware" projects from start to finish and it looks quite gorgeous in that red plastic 😍 diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html index a2d2e79..7fae19d 100644 --- a/layouts/shortcodes/img.html +++ b/layouts/shortcodes/img.html @@ -3,7 +3,9 @@ {{ if eq $origImage.MediaType.SubType "svg" }} .Get "alt" {{ else }} - {{ $image := $origImage.Resize "720x" }} + {{ $resizeAdd := .Get "resizeAdd" | default "" }} + {{ $resize := printf "%s%s" (.Get "resize" | default "720x webp Lanczos ") $resizeAdd }} + {{ $image := $origImage.Resize $resize }} .Get "alt"