From 09440190aaa4050698fe48a7ab708c88cbbfa19b Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Mon, 22 Apr 2024 12:15:51 +0800 Subject: [PATCH] :bug: Fix: fix image llightgallery render error (#420) --- layouts/_default/_markup/render-image.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index 23f2f897c..abac89f47 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -1,11 +1,13 @@ +{{- $params := .Page.Params | merge site.Params.page -}} {{- if .Title | and .Text -}} + {{- $linked := ne $params.lightgallery false -}}
- {{- dict "Src" .Destination "Alt" .Text "Caption" .Text "Title" .Title "Linked" true "Responsive" true | partial "plugin/image.html" -}} + {{- dict "Src" .Destination "Alt" .Text "Caption" .Text "Title" .Title "Linked" $linked "Responsive" true | partial "plugin/image.html" -}}
{{- .Text | safeHTML -}}
{{- else -}} - {{- $linked := (eq (partial "function/params.html").lightgallery "force") | or (ne .Title "") -}} + {{- $linked := (eq $params.lightgallery "force") | or ($params.lightgallery | and (ne .Title "")) -}} {{- dict "Src" .Destination "Alt" .Text "Title" .Title "Linked" $linked "Responsive" true | partial "plugin/image.html" -}} {{- end -}}