From e3bc1b64c38a827282b2c7e7efe3d3b4b7c8507a Mon Sep 17 00:00:00 2001 From: Razon Yang Date: Sun, 14 Jan 2024 00:04:39 +0800 Subject: [PATCH] fix: broken width and height values (#36) --- layouts/partials/images/picture.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/layouts/partials/images/picture.html b/layouts/partials/images/picture.html index 6d9b829..22d5586 100644 --- a/layouts/partials/images/picture.html +++ b/layouts/partials/images/picture.html @@ -11,10 +11,10 @@ {{- $attrs = $attrs | append `loading="lazy"` }} {{- end }} {{- with .naturalHeight }} - {{- $attrs = $attrs | append (printf `height="%d"` .) }} + {{- $attrs = $attrs | append (printf `height="%s"` (string .)) }} {{- end }} {{- with .naturalWidth }} - {{- $attrs = $attrs | append (printf `width="%d"` .) }} + {{- $attrs = $attrs | append (printf `width="%s"` (string .)) }} {{- end }} {{- with .style }} {{- $attrs = $attrs | append (printf `style="%s"` (delimit . `; `)) }} @@ -24,10 +24,10 @@ {{- $attrs = $attrs | append (printf `data-src="%s"` .) }} {{- end }} {{- with .originalWidth }} - {{- $attrs = $attrs | append (printf `data-width="%d"` .) }} + {{- $attrs = $attrs | append (printf `data-width="%s"` (string .)) }} {{- end }} {{- with .originalHeight }} - {{- $attrs = $attrs | append (printf `data-height="%d"` .) }} + {{- $attrs = $attrs | append (printf `data-height="%s"` (string .)) }} {{- end }} {{- end }}