shithub: hugo

Download patch

ref: 564cf1bb11e100891992e9131b271a79ea7fc528
parent: 4b4bdcfe740d988e4cfb4fee53eced6985576abd
author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
date: Sat Aug 17 13:11:41 EDT 2019

tpl: Avoid "home page warning" in RSS template

See #6238

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