From ce55eca73bdfc6c043137dcbd7a2bda24cfce9af Mon Sep 17 00:00:00 2001
From: Andrii Yefremov <56955307+decatetsu@users.noreply.github.com>
Date: Mon, 29 Aug 2022 18:15:18 +0000
Subject: [PATCH] Add Ukrainian translation (#191)

---
 layouts/_default/_markup/render-image.html |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html
index ff4e8b3..dbcf732 100644
--- a/layouts/_default/_markup/render-image.html
+++ b/layouts/_default/_markup/render-image.html
@@ -1,8 +1,9 @@
 {{$src := .Destination | safeURL }}
+{{$width := index (split .Text "|") 1 | default "auto" }}
 {{$external := strings.HasPrefix $src "http" }}
 {{- if $external -}}
-<img src="{{ $src }}" alt="{{ .Text }}" {{ with .Title }} title="{{ . }}" {{ end }} />
+<img src="{{ $src }}" width="{{ $width }}" alt="{{ .Text }}" {{ with .Title }} title="{{ . }}" {{ end }} />
 {{- else -}}
 {{$fixedUrl := (cond (hasPrefix $src "/") $src (print "/" $src)) | urlize}}
-<img src="{{ $fixedUrl }}" alt="{{ .Text }}" {{ with .Title }} title="{{ . }}" {{ end }} />
+<img src="{{.Page.Site.BaseURL}}{{ $fixedUrl }}" width="{{ $width }}" alt="{{ .Text }}" {{ with .Title }} title="{{ . }}" {{ end }} />
 {{- end -}}

--
Gitblit v1.10.0