From 2583a1c4bfa498e0d71730e956362c160c472d65 Mon Sep 17 00:00:00 2001 From: Adam Ormsby Date: Tue, 28 Apr 2020 20:58:39 -0500 Subject: [PATCH] add cover image from front matter, set auto cover grab as backup following similar hugo standard --- layouts/_default/rss.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 81aa8f6..0a3a38e 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -28,6 +28,15 @@ {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} {{ .Permalink }} + {{ if .Params.Cover }} + {{ if .Params.UseRelativeCover }}{{ printf "%s%s%s%s" ""}} + {{ else }}{{ printf "%s%s%s" ""}} + {{ end }} + {{ else }} + {{ $images := .Resources.ByType "image" }} + {{ $featured := $images.GetMatch "{*featured*,*cover*,*thumbnail*}" }} + {{ with $featured }}{{ printf "%s%s%s" ""}}{{ end }} + {{ end }} {{ .Summary | html }}