Skip to content

Commit 4ab0c92

Browse files
committed
Fix rendering issue with images in an alert box
1 parent 70f50fa commit 4ab0c92

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

layouts/shortcodes/figure.html

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{{ $src := (.Page.Resources.GetMatch (printf "**%s*" (.Get "src"))) }}
22
<figure>
3-
<!-- Yiyun - only adds on-click link to images that have a link parameter, default target is in new tab/window -->
3+
<!-- Yiyun - only adds clickable links to images that have a link parameter, default target is in new tab/window -->
44
{{- if .Get "link" -}}
5-
<a href="{{ .Get "link" }}" target="{{ with .Get "target" }}{{ . }}{{ else }}_blank{{ end }}"{{ with .Get "rel" }} rel="{{ . }}"{{ end }}>
6-
{{- end }}
5+
<a href="{{ .Get "link" }}"
6+
{{- else -}}
7+
<link href="{{ .Get "src" }}"
8+
{{- end }} target="{{ with .Get "target" }}{{ . }}{{ else }}_blank{{ end }}"{{ with .Get "rel" }} rel="{{ . }}"{{ end }}>
79
<img src="{{ if $src }}{{ $src.RelPermalink }}{{ else }}{{ .Get "src" }}{{ end }}"
810
{{- if or (.Get "alt") (.Get "caption") }}
911
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"

0 commit comments

Comments
 (0)