diff options
author | James Ray <rihoj1@gmail.com> | 2022-03-01 07:10:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-01 07:10:10 +0300 |
commit | e151dad4618f29fe81b0838aba3f308b04e7c266 (patch) | |
tree | 4be230f7364d5bf18a48798416620c6a82b08f2e | |
parent | 711d4c774923a3134e3f3164d45c994e07c8afc3 (diff) |
Refine rss build logic (#545)
* Add refine rss build logic
* Switch to .RelPermalink since URL is deprecated
-rw-r--r-- | layouts/_default/rss.xml | 8 |
1 files 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 "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} {{- end -}} {{ range $pages }} - {{- if ne .URL "search" -}} + {{- if ne .RelPermalink "/search/" -}} <item> <title>{{ .Title }}</title> <link>{{ .Permalink }}</link> |