summaryrefslogtreecommitdiff
path: root/layouts/_default/_markup/render-image.html
blob: 9c3c9a785c4b68fc090b5ce6fed5ba9d3846e7d3 (plain)
1
2
3
4
5
6
7
8
9
{{- $img := .Page.Resources.GetMatch .Destination -}}
{{- if and (not $img) .Page.File -}}
  {{ $path := path.Join .Page.File.Dir .Destination }}
  {{- $img = resources.Get $path -}}
{{- end -}}

{{- with $img -}}
  <img loading="lazy" src="{{ $img.RelPermalink }}" alt="{{ $.Text }}" {{ with $.Title}} title="{{ . }}" {{ end }} />
{{- end -}}