blob: 3a98b21c187e19ad26675f672c04c303230d02a9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
{{- $src := .Src -}}
{{- with dict "Path" .Src "Resources" .Resources | partial "function/resource.html" -}}
{{- $src = .RelPermalink -}}
{{- end -}}
{{- $alt := .Alt | default $src -}}
{{- if .Linked -}}
<a target="_blank" href="{{ .Src | safeURL }}" title="{{ .Title | default $alt }}" {{ with .Rel }} rel="{{ . }}"{{ end }}>
<img loading="lazy" decoding="async"
data-sizes="auto"
src="{{ .Src | safeURL }}"
alt="{{ $alt }}"{{ with .Height }} height="{{ . }}"{{ end }}{{ with .Width }} width="{{ . }}"{{ end }}
/>
</a>
{{- else -}}
<img loading="lazy" decoding="async"
src="{{ .Src | safeURL }}"
alt="{{ $alt }}"
title="{{ .Title | default $alt }}"{{ with .Height }} height="{{ . }}"{{ end }}{{ with .Width }} width="{{ . }}"{{ end }}
/>
{{- end -}}
|