From c1b0eafce668c0c7498a5875c23c074eeb71e842 Mon Sep 17 00:00:00 2001
From: chaosarium <38693485+chaosarium@users.noreply.github.com>
Date: Thu, 22 Dec 2022 18:34:21 +0000
Subject: [PATCH] feat: Added simplified Chinese translations (#257)

---
 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