diff options
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/tplimpl/embedded/templates.autogen.go | 5 | ||||
-rw-r--r-- | tpl/tplimpl/embedded/templates/_default/rss.xml | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/tpl/tplimpl/embedded/templates.autogen.go b/tpl/tplimpl/embedded/templates.autogen.go index a38ab29fa..a386a05a5 100644 --- a/tpl/tplimpl/embedded/templates.autogen.go +++ b/tpl/tplimpl/embedded/templates.autogen.go @@ -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 -}} diff --git a/tpl/tplimpl/embedded/templates/_default/rss.xml b/tpl/tplimpl/embedded/templates/_default/rss.xml index b5050015f..8f7a2f697 100644 --- a/tpl/tplimpl/embedded/templates/_default/rss.xml +++ b/tpl/tplimpl/embedded/templates/_default/rss.xml @@ -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 -}} |