From f8edb8e8ab98d4d429f71b37c03a49654b976465 Mon Sep 17 00:00:00 2001 From: tdro Date: Thu, 16 Jun 2022 16:42:17 -0400 Subject: assets/templates/markdown-feed: Guard against enclosures that are not images Other enclosure types can be handled differently. --- assets/templates/markdown-feed.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'assets/templates') diff --git a/assets/templates/markdown-feed.yaml b/assets/templates/markdown-feed.yaml index 3e7d9a9..005d411 100644 --- a/assets/templates/markdown-feed.yaml +++ b/assets/templates/markdown-feed.yaml @@ -30,7 +30,21 @@ feed: {{- end }} {{ with .enclosure -}} +{{- if or + (in . "apng") + (in . "avif") + (in . "gif") + (in . "jfif") + (in . "jpeg") + (in . "jpg") + (in . "pjp") + (in . "pjpeg") + (in . "png") + (in . "svg") + (in . "webp") +-}} ![{{ $enclosureDescription }}]({{ . }} " {{ $enclosureDescription }}" ) +{{- end -}} {{- end }} -- cgit v1.2.3