From 2da8aab88f016452e456832eac57e772d9da0083 Mon Sep 17 00:00:00 2001 From: Choi Sung Hwan Date: Sat, 2 Jan 2021 12:09:56 +0900 Subject: [PATCH] rssLimit bug fix fix #380 --- layouts/_default/rss.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 64ec7a9..18561d2 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -21,9 +21,11 @@ {{ printf "" .Permalink .MediaType | safeHTML }} {{ end }} + {{- $limit := .Site.Config.Services.RSS.Limit -}} + {{ if .IsHome }} - {{ $filteredPages := .Site.RegularPages }} + {{ $filteredPages := .Site.RegularPages | first $limit }} {{ range $.Param "notAllowedTypesInHomeFeed" }} {{ $filteredPages = (where $filteredPages "Type" "!=" (lower .)) }} {{ end }} @@ -68,7 +70,7 @@ {{ else }} - {{ range .Pages }} + {{ range (.Pages | first $limit) }} {{ .Title }} {{ .Permalink }}