Add link_to_page, page_link RSS config

master
Will Faught 2 years ago
parent 43fac7337a
commit 71e1aacc9e

@ -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 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] [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 <will.faught@example.com>" managing_editor = "" # Example is "Will Faught <will.faught@example.com>"
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 <will.faught@example.com>" web_master = "" # Example is "Will Faught <will.faught@example.com>"
[paige.git] [paige.git]

@ -40,6 +40,7 @@
{{ end }} {{ end }}
{{ range $pages }} {{ range $pages }}
<item> <item>
{{ $title := .Title | markdownify | plainify }}
{{ with partial "paige/authors.html" . }} {{ with partial "paige/authors.html" . }}
{{ $primary := index . 0 }} {{ $primary := index . 0 }}
{{ $author := "" }} {{ $author := "" }}
@ -50,11 +51,18 @@
{{ end }} {{ end }}
<author>{{ $author }}</author> <author>{{ $author }}</author>
{{ end }} {{ end }}
{{ if .Content }} {{ $description := .Content }}
<description>{{ printf "<![CDATA[%s]]>" .Content | safeHTML }}</description> {{ if $description }}
{{ else if .Description }} {{ if and .Params.link (not (.Param "paige.feed.rss.link_to_page")) }}
<description>{{ printf "<![CDATA[%s]]>" (.Description | markdownify) | safeHTML }}</description> {{ $link := or (.Param "paige.feed.rss.page_link" | markdownify) "⏎" }}
{{ $footer := printf `<p><a href="%s" title="%s">%s</a></p>` .Permalink $title $link }}
{{ $description = print $description $footer }}
{{ end }} {{ end }}
{{ end }}
{{ if not $description }}
{{ $description = .Description | markdownify}}
{{ end }}
<description>{{ printf "<![CDATA[%s]]>" $description | safeHTML }}</description>
{{ $guid := "" }} {{ $guid := "" }}
{{ $permalink := false }} {{ $permalink := false }}
{{ if .Params.id }} {{ if .Params.id }}
@ -74,8 +82,8 @@
{{ with .PublishDate }} {{ with .PublishDate }}
<pubDate>{{ .Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</pubDate> <pubDate>{{ .Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</pubDate>
{{ end }} {{ end }}
{{ with .Title }} {{ with $title }}
<title>{{ . | markdownify | plainify | htmlUnescape | safeHTML }}</title> <title>{{ . | safeHTML }}</title>
{{ end }} {{ end }}
{{ if and (not .Description) (not .Title) }} {{ if and (not .Description) (not .Title) }}
{{ warnf "layouts/_default/rss.xml: Page %s does not have a title or description" .RelPermalink }} {{ warnf "layouts/_default/rss.xml: Page %s does not have a title or description" .RelPermalink }}

Loading…
Cancel
Save