redstrate.com/themes/red/layouts/_default/_markup/render-image.rss.xml

24 lines
721 B
XML
Raw Normal View History

2025-01-01 10:14:39 -05:00
{{- $url := .Destination | safeURL -}}
{{- $img := .Page.Resources.GetMatch .Destination -}}
{{- if and (not $img) .Page.File -}}
{{ with .Page.File }}
{{ $path := path.Join .Dir $url }}
{{- $img = resources.Get $path -}}
{{ end }}
{{- end -}}
{{- if and (not $img) .Page.File -}}
{{- $img = resources.Get .Destination -}}
{{- end -}}
{{- with $img -}}
{{ if eq .MediaType.SubType "svg" }}
<img class="actual-article-img" src="{{ $img.RelPermalink }}" alt="{{ $.Text }}">
{{ else }}
<img class="actual-article-img" width="{{ $img.Width }}" height="{{ $img.Height }}" src="{{ $img.RelPermalink }}" alt="{{ $.Text }}">
{{ end }}
{{- else -}}
<em>Unable to find image {{ $url }}!</em>
{{- end -}}