From e151dad4618f29fe81b0838aba3f308b04e7c266 Mon Sep 17 00:00:00 2001 From: James Ray Date: Mon, 28 Feb 2022 23:10:10 -0500 Subject: [PATCH] Refine rss build logic (#545) * Add refine rss build logic * Switch to .RelPermalink since URL is deprecated --- layouts/_default/rss.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index a2d34ae..7c5a307 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -1,10 +1,12 @@ {{- $pctx := . -}} {{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} {{- $pages := slice -}} -{{- if or $.IsHome $.IsSection -}} +{{- if $.IsHome -}} +{{- $pages = $pctx.RegularPages -}} +{{- else if $.IsSection -}} {{- $pages = $pctx.RegularPagesRecursive -}} {{- else -}} -{{- $pages = $pctx.Pages -}} +{{- $pages = $pctx.RegularPagesRecursive -}} {{- end -}} {{- $limit := .Site.Config.Services.RSS.Limit -}} {{- if ge $limit 1 -}} @@ -26,7 +28,7 @@ {{ printf "" .Permalink .MediaType | safeHTML }} {{- end -}} {{ range $pages }} - {{- if ne .URL "search" -}} + {{- if ne .RelPermalink "/search/" -}} {{ .Title }} {{ .Permalink }}