diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 10cd310e..c0fdd91e 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -60,8 +60,15 @@ {{ end }} {{ range $subpage := $subpages }} + {{ $authors := partial "paige/authors.html" . }} + {{ $description := .Content }} + {{ $guid := "" }} + {{ $paramlink := and .Params.link (not (.Param "paige.feed.link_to_page")) }} + {{ $permalink := false }} + {{ $pubdate := .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 MST" }} {{ $title := .Title | markdownify | plainify }} - {{ with partial "paige/authors.html" . }} + {{ $link := cond $paramlink .Params.link .Permalink }} + {{ with $authors }} {{ $primary := index . 0 }} {{ $author := "" }} {{ if and $primary.name $primary.email }} @@ -71,9 +78,8 @@ {{ end }} {{ $author }} {{ end }} - {{ $description := .Content }} {{ if $description }} - {{ if and .Params.link (not (.Param "paige.feed.link_to_page")) }} + {{ if $paramlink }} {{ $link := or (.Param "paige.feed.page_link" | markdownify) "⏎" }} {{ $footer := printf `

%s

` .Permalink $title $link }} {{ $description = print $description $footer }} @@ -83,8 +89,6 @@ {{ $description = .Description | markdownify}} {{ end }} {{ printf "" $description | safeHTML }} - {{ $guid := "" }} - {{ $permalink := false }} {{ if .Params.id }} {{ $guid = .Params.id }} {{ else if not .Date.IsZero }} @@ -98,16 +102,14 @@ {{ end }} {{ $guids = merge (dict $guid .RelPermalink) $guids }} {{ $guid }} - {{ if and .Params.link (not (.Param "paige.feed.link_to_page")) }} - {{ .Params.link | safeURL }} - {{ else }} - {{ .Permalink | safeURL }} + {{ with $link }} + {{ . }} {{ end }} - {{ with .PublishDate }} - {{ .Format "Mon, 02 Jan 2006 15:04:05 -0700" }} + {{ with $pubdate }} + {{ . }} {{ end }} {{ with $title }} - {{ . | safeHTML }} + {{ . }} {{ end }} {{ if and (not .Description) (not .Title) }} {{ warnf "layouts/_default/rss.xml: Page %s does not have a title or description" .RelPermalink }}