rssLimit bug fix

fix #380
This commit is contained in:
Choi Sung Hwan 2021-01-02 12:09:56 +09:00
parent 290800d19a
commit 2da8aab88f
1 changed files with 4 additions and 2 deletions

View File

@ -21,9 +21,11 @@
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{ end }} {{ end }}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{ if .IsHome }} {{ if .IsHome }}
{{ $filteredPages := .Site.RegularPages }} {{ $filteredPages := .Site.RegularPages | first $limit }}
{{ range $.Param "notAllowedTypesInHomeFeed" }} {{ range $.Param "notAllowedTypesInHomeFeed" }}
{{ $filteredPages = (where $filteredPages "Type" "!=" (lower .)) }} {{ $filteredPages = (where $filteredPages "Type" "!=" (lower .)) }}
{{ end }} {{ end }}
@ -68,7 +70,7 @@
{{ else }} {{ else }}
{{ range .Pages }} {{ range (.Pages | first $limit) }}
<item> <item>
<title>{{ .Title }}</title> <title>{{ .Title }}</title>
<link>{{ .Permalink }}</link> <link>{{ .Permalink }}</link>