Add excluderss page parameter

master
Will Faught 3 years ago
parent 2e1c02ddc6
commit 8e5faf8813

@ -98,6 +98,9 @@ an anchor around the page title, if any. If the page or site parameter
The `paige-search` layout provides full site search. It requires setting
`outputs.home` to `["html", "json", "rss"]` in `config.yaml`.
Set page parameter `excluderss` to true to exclude it from RSS. Doing so
for a list page excludes the entire directory.
If `partials/paige-head-last.html` exists in the site, it is included at
the end of the head tag. If `partials/paige-body-last.html` exists in
the site, it is included at the end of the body tag.

@ -2,6 +2,7 @@
{{ if .IsHome }}
{{ $item = .Site }}
{{ end }}
{{ if not .Params.excluderss }}
{{ $pages := slice }}
{{ if or $.IsHome $.IsSection }}
{{ $pages = $item.RegularPages }}
@ -12,6 +13,7 @@
{{ if ge $limit 1 }}
{{ $pages = $pages | first $limit }}
{{ end }}
{{ $pages = where $pages "Params.excluderss" "ne" true }}
{{ $title := partial "paige-titles.html" . }}
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
@ -65,3 +67,4 @@
{{ end }}
</channel>
</rss>
{{ end }}

Loading…
Cancel
Save