summaryrefslogtreecommitdiff
path: root/layouts/_default/rss.xml
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/_default/rss.xml')
-rw-r--r--layouts/_default/rss.xml14
1 files changed, 10 insertions, 4 deletions
diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml
index e49c966..a546783 100644
--- a/layouts/_default/rss.xml
+++ b/layouts/_default/rss.xml
@@ -1,15 +1,21 @@
{{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := slice -}}
-{{- if or $.IsHome $.IsSection -}}
-{{- $pages = $pctx.RegularPages -}}
+
+{{- if or $.IsHome -}}
+ {{/* remove page at top level from RSS, for exmaple "about" page */}}
+ {{- $pages = where $pctx.RegularPages "Type" "ne" "page" -}}
+{{- else if $.IsSection -}}
+ {{- $pages = $pctx.RegularPages -}}
{{- else -}}
-{{- $pages = $pctx.Pages -}}
+ {{- $pages = $pctx.Pages -}}
{{- end -}}
+
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
-{{- $pages = $pages | first $limit -}}
+ {{- $pages = $pages | first $limit -}}
{{- end -}}
+
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>