Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/blog.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@gmail.com>2022-07-15 08:37:12 +0300
committerGitHub <noreply@github.com>2022-07-15 08:37:12 +0300
commit2c4bd9791844204aaaba608dda6bd5d1fb79b196 (patch)
treecbdf50283322fea1957374c0440ae918596ea188
parentd06fa062d8c43bd1270aebb275878f08ad8af3ba (diff)
Improve _markup/render-image.html (#293)
-rw-r--r--src/layouts/_default/_markup/render-image.html5
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 }}">