diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index c0fdd91e..81be6c23 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -37,27 +37,37 @@ {{ printf `` ($page.Permalink | safeURL) | safeHTML }} + {{ with $html }} {{ printf `` (.Permalink | safeURL) .MediaType | safeHTML }} {{ end }} + {{ with $copyright }} {{ . }} {{ end }} + {{ $description }} + {{ with $language }} {{ . }} {{ end }} + {{ with $lastbuilddate }} {{ . }} {{ end }} + {{ $link }} + {{ with $managingeditor }} {{ . }} {{ end }} + {{ $title }} + {{ with $webmaster }} {{ . }} {{ end }} + {{ range $subpage := $subpages }} {{ $authors := partial "paige/authors.html" . }} @@ -67,17 +77,22 @@ {{ $permalink := false }} {{ $pubdate := .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 MST" }} {{ $title := .Title | markdownify | plainify }} + {{ $link := cond $paramlink .Params.link .Permalink }} + {{ with $authors }} {{ $primary := index . 0 }} {{ $author := "" }} + {{ if and $primary.name $primary.email }} {{ $author = printf `%s <%s>` $primary.name $primary.email }} {{ else if $primary.email }} {{ $author = $primary.email }} {{ end }} + {{ $author }} {{ end }} + {{ if $description }} {{ if $paramlink }} {{ $link := or (.Param "paige.feed.page_link" | markdownify) "⏎" }} @@ -85,10 +100,13 @@ {{ $description = print $description $footer }} {{ end }} {{ end }} + {{ if not $description }} {{ $description = .Description | markdownify}} {{ end }} + {{ printf "" $description | safeHTML }} + {{ if .Params.id }} {{ $guid = .Params.id }} {{ else if not .Date.IsZero }} @@ -97,20 +115,26 @@ {{ $guid = .RelPermalink }} {{ $permalink = false }} {{ end }} + {{ with index $guids $guid }} {{ warnf "layouts/_default/rss.xml: Pages %s and %s have the same GUID" . $subpage.RelPermalink }} {{ end }} + {{ $guids = merge (dict $guid .RelPermalink) $guids }} {{ $guid }} + {{ with $link }} {{ . }} {{ end }} + {{ with $pubdate }} {{ . }} {{ end }} + {{ with $title }} {{ . }} {{ end }} + {{ if and (not .Description) (not .Title) }} {{ warnf "layouts/_default/rss.xml: Page %s does not have a title or description" .RelPermalink }} {{ end }}