diff --git a/README.md b/README.md index e51cf18a..b1cdf668 100644 --- a/README.md +++ b/README.md @@ -277,7 +277,9 @@ link_to_page = false # Link to the page instead of the front matter link, if pre page_link = "⏎" # If a front matter link is present, and link_to_page is false, link to the page with this text [paige.feed.rss] +link_to_page = false # Link to the page instead of the front matter link, if present managing_editor = "" # Example is "Will Faught " +page_link = "⏎" # If a front matter link is present, and link_to_page is false, link to the page with this text web_master = "" # Example is "Will Faught " [paige.git] diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 7c41d1fb..9fdf2663 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -40,6 +40,7 @@ {{ end }} {{ range $pages }} + {{ $title := .Title | markdownify | plainify }} {{ with partial "paige/authors.html" . }} {{ $primary := index . 0 }} {{ $author := "" }} @@ -50,11 +51,18 @@ {{ end }} {{ $author }} {{ end }} - {{ if .Content }} - {{ printf "" .Content | safeHTML }} - {{ else if .Description }} - {{ printf "" (.Description | markdownify) | safeHTML }} + {{ $description := .Content }} + {{ if $description }} + {{ if and .Params.link (not (.Param "paige.feed.rss.link_to_page")) }} + {{ $link := or (.Param "paige.feed.rss.page_link" | markdownify) "⏎" }} + {{ $footer := printf `

%s

` .Permalink $title $link }} + {{ $description = print $description $footer }} + {{ end }} + {{ end }} + {{ if not $description }} + {{ $description = .Description | markdownify}} {{ end }} + {{ printf "" $description | safeHTML }} {{ $guid := "" }} {{ $permalink := false }} {{ if .Params.id }} @@ -74,8 +82,8 @@ {{ with .PublishDate }} {{ .Format "Mon, 02 Jan 2006 15:04:05 -0700" }} {{ end }} - {{ with .Title }} - {{ . | markdownify | plainify | htmlUnescape | safeHTML }} + {{ 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 }}