2024-01-30 05:43:20 -05:00
|
|
|
{{- $u := urls.Parse .Destination -}}
|
|
|
|
{{- $src := $u.String -}}
|
|
|
|
{{- if not $u.IsAbs -}}
|
2024-04-11 11:46:18 -04:00
|
|
|
{{- with or (.PageInner.Resources.Get $u.Path) (resources.Get $u.Path) -}}
|
2024-01-30 05:43:20 -05:00
|
|
|
{{- $src = .RelPermalink -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
2024-03-05 19:06:50 -05:00
|
|
|
{{- $attributes := merge .Attributes (dict "alt" .Text "src" $src "title" .Title) -}}
|
2024-01-30 05:43:20 -05:00
|
|
|
<img
|
|
|
|
{{- range $k, $v := $attributes -}}
|
|
|
|
{{- if $v -}}
|
|
|
|
{{- printf " %s=%q" $k $v | safeHTMLAttr -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}>
|
|
|
|
{{- /**/ -}}
|