diff options
author | XhmikosR <xhmikosr@gmail.com> | 2022-07-15 08:37:12 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-15 08:37:12 +0300 |
commit | 2c4bd9791844204aaaba608dda6bd5d1fb79b196 (patch) | |
tree | cbdf50283322fea1957374c0440ae918596ea188 | |
parent | d06fa062d8c43bd1270aebb275878f08ad8af3ba (diff) |
Improve _markup/render-image.html (#293)
-rw-r--r-- | src/layouts/_default/_markup/render-image.html | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/layouts/_default/_markup/render-image.html b/src/layouts/_default/_markup/render-image.html index 9969470e..70214425 100644 --- a/src/layouts/_default/_markup/render-image.html +++ b/src/layouts/_default/_markup/render-image.html @@ -1,4 +1,5 @@ -{{- $img := imageConfig (add "/src/static" (.Destination | safeURL)) -}} +{{- $src := .Destination | safeURL -}} +{{- $config := imageConfig (add "/src/static" $src) -}} {{- $classes := "d-block img-fluid mb-2 rounded border" -}} -<img src="{{ .Destination | safeURL }}" class="{{ $classes }}" alt="{{ .Text }}" loading="lazy" width="{{ $img.Width }}" height="{{ $img.Height }}"> +<img src="{{ $src }}" class="{{ $classes }}" alt="{{ .Text }}" loading="lazy" width="{{ $config.Width }}" height="{{ $config.Height }}"> |