From 5fae5fea82a07e275195f03f4a215c710da4ce07 Mon Sep 17 00:00:00 2001 From: Uwe Schmidt Date: Thu, 23 Mar 2023 18:52:41 +0100 Subject: [PATCH] Adjust whitespace for `srcset` links --- layouts/_default/_markup/render-image.html | 8 ++++---- layouts/_default/single.html | 11 ++++++----- layouts/partials/article-link.html | 4 ++-- layouts/shortcodes/figure.html | 8 ++++---- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index 81ec946e..9c7096dc 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -24,10 +24,10 @@ src="{{ .RelPermalink }}" {{ else }} srcset=" - {{ (.Resize "330x").RelPermalink }} 330w, - {{ (.Resize "660x").RelPermalink }} 660w, - {{ (.Resize "1024x").RelPermalink }} 1024w, - {{ (.Resize "1320x").RelPermalink }} 2x" + {{- (.Resize "330x").RelPermalink }} 330w, + {{- (.Resize "660x").RelPermalink }} 660w, + {{- (.Resize "1024x").RelPermalink }} 1024w, + {{- (.Resize "1320x").RelPermalink }} 2x" src="{{ (.Resize "660x").RelPermalink }}" {{ end }} {{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 3bb6ea80..fb030cce 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -23,11 +23,12 @@ {{ if lt .Width 660 }} src="{{ .RelPermalink }}" {{ else }} - srcset=" {{ (.Resize "330x").RelPermalink }} 330w, - {{ (.Resize "660x").RelPermalink }} 660w, {{ (.Resize "1024x").RelPermalink }} - 1024w, {{ (.Resize "1320x").RelPermalink }} 2x" - src="{{ (.Resize "660x").RelPermalink }}" - {{ end }} + srcset=" + {{- (.Resize "330x").RelPermalink }} 330w, + {{- (.Resize "660x").RelPermalink }} 660w, + {{- (.Resize "1024x").RelPermalink }} 1024w, + {{- (.Resize "1320x").RelPermalink }} 2x" + {{ end }} {{ end }} alt="{{ $.Params.featureAlt | default $.Params.coverAlt | default "" }}" /> diff --git a/layouts/partials/article-link.html b/layouts/partials/article-link.html index d2907aed..39226c33 100644 --- a/layouts/partials/article-link.html +++ b/layouts/partials/article-link.html @@ -19,8 +19,8 @@ sm:max-w-[10rem]" src="{{ .RelPermalink }}" {{ else }} class="w-24 rounded-md sm:w-40" srcset=" - {{- (.Fill "160x120 smart").RelPermalink }} - 160w, {{- (.Fill "320x240 smart").RelPermalink }} 2x" + {{- (.Fill "160x120 smart").RelPermalink }} 160w, + {{- (.Fill "320x240 smart").RelPermalink }} 2x" src="{{ (.Fill "160x120 smart").RelPermalink }}" {{ end }} /> diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index 58ff4fc2..9b013442 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -28,10 +28,10 @@ src="{{ .RelPermalink }}" {{ else }} srcset=" - {{ (.Resize "330x").RelPermalink }} 330w, - {{ (.Resize "660x").RelPermalink }} 660w, - {{ (.Resize "1024x").RelPermalink }} 1024w, - {{ (.Resize "1320x").RelPermalink }} 2x" + {{- (.Resize "330x").RelPermalink }} 330w, + {{- (.Resize "660x").RelPermalink }} 660w, + {{- (.Resize "1024x").RelPermalink }} 1024w, + {{- (.Resize "1320x").RelPermalink }} 2x" src="{{ (.Resize "660x").RelPermalink }}" {{ end }} {{ end }}