diff --git a/themes/red/layouts/_default/_markup/render-image.rss.xml b/themes/red/layouts/_default/_markup/render-image.rss.xml new file mode 100644 index 0000000..983e498 --- /dev/null +++ b/themes/red/layouts/_default/_markup/render-image.rss.xml @@ -0,0 +1,23 @@ +{{- $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" }} + {{ $.Text }} + {{ else }} + {{ $.Text }} + {{ end }} +{{- else -}} + Unable to find image {{ $url }}! +{{- end -}}