File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
1
{{ $src := (.Page.Resources.GetMatch (printf "**%s*" (.Get "src"))) }}
2
2
< 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 -->
4
4
{{- 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 }} >
7
9
< img src ="{{ if $src }}{{ $src.RelPermalink }}{{ else }}{{ .Get "src " }}{{ end }}"
8
10
{{- if or (.Get "alt") (.Get "caption") }}
9
11
alt="{{ with .Get "alt " }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
You can’t perform that action at this time.
0 commit comments