tpl: Use RegularPages for RSS template

This is in line with how it was in Hugo 0.56.

See #6238
This commit is contained in:
Bjørn Erik Pedersen 2019-08-17 19:37:14 +02:00
parent ea68160300
commit 88d6993612
No known key found for this signature in database
GPG Key ID: 330E6E2BD4859D8F
2 changed files with 6 additions and 4 deletions

View File

@ -19,8 +19,9 @@ package embedded
// EmbeddedTemplates represents all embedded templates.
var EmbeddedTemplates = [][2]string{
{`_default/robots.txt`, `User-agent: *`},
{`_default/rss.xml`, `{{- $pages := "" -}}
{{- if .IsHome -}}{{- $pages = .Site.RegularPages -}}{{- else -}}{{- $pages = .Pages -}}{{- end -}}
{`_default/rss.xml`, `{{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := $pctx.RegularPages -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
{{- $pages = $pages | first $limit -}}

View File

@ -1,5 +1,6 @@
{{- $pages := "" -}}
{{- if .IsHome -}}{{- $pages = .Site.RegularPages -}}{{- else -}}{{- $pages = .Pages -}}{{- end -}}
{{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := $pctx.RegularPages -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
{{- $pages = $pages | first $limit -}}