summaryrefslogtreecommitdiff
path: root/layouts/_default/rss.xml
diff options
context:
space:
mode:
authorleafee98 <leafee98@hotmail.com>2022-05-16 20:41:20 +0800
committerleafee98 <leafee98@hotmail.com>2022-05-16 20:41:20 +0800
commit715a82f5acf80b125c5e5ead2ff5765c075efa6b (patch)
treed64e0817e3ab9b129d13664739e9afc10901dfa7 /layouts/_default/rss.xml
parentb343bac3f9e267501d25068686f4eec0adaaab9d (diff)
multi RSS hyperlink base on section and taxonomy
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>