From 34aadcf2c0f0a588bb47da9f9f05da1fdd6214bb Mon Sep 17 00:00:00 2001 From: Shaform Date: Thu, 16 Jul 2020 23:12:08 -0400 Subject: [PATCH] follow hugo's rss logic --- layouts/rss.xml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/layouts/rss.xml b/layouts/rss.xml index 2d14f51..444a1ee 100644 --- a/layouts/rss.xml +++ b/layouts/rss.xml @@ -1,6 +1,11 @@ {{- $pctx := . -}} {{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} -{{- $pages := $pctx.RegularPages -}} +{{- $pages := slice -}} +{{- if or $.IsHome $.IsSection -}} +{{- $pages = $pctx.RegularPages -}} +{{- else -}} +{{- $pages = $pctx.Pages -}} +{{- end -}} {{- $limit := .Site.Config.Services.RSS.Limit -}} {{- if ge $limit 1 -}} {{- $pages = $pages | first $limit -}} @@ -21,7 +26,7 @@ {{.}}{{end}}{{ if not .Date.IsZero }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} {{ with .OutputFormats.Get "RSS" }} - {{ printf "" .Permalink .MediaType | safeHTML }} + {{ printf "" .Permalink .MediaType | safeHTML }} {{ end }} {{ range $pages }}