diff options
author | Philip Rosenberg-Watt <p.rosenberg-watt@cablelabs.com> | 2019-11-13 22:59:06 +0300 |
---|---|---|
committer | Philip Rosenberg-Watt <p.rosenberg-watt@cablelabs.com> | 2019-11-19 19:01:22 +0300 |
commit | 35f6be96fdcf7325b43c80cf0b9dac1ca06eeafb (patch) | |
tree | 431b9488689d29f7616f7e9e643b63f304e0b8a3 | |
parent | 862b806512d2d1a43893be6cbb64746d3b037416 (diff) |
Fix RSS
New template, adapted.
-rw-r--r-- | layouts/rss.xml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/layouts/rss.xml b/layouts/rss.xml index 12dedab..aeb7526 100644 --- a/layouts/rss.xml +++ b/layouts/rss.xml @@ -1,9 +1,11 @@ -{{- $pages := .Data.Pages -}} +{{- $pctx := . -}} +{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} +{{- $pages := $pctx.RegularPages -}} {{- $limit := .Site.Config.Services.RSS.Limit -}} {{- if ge $limit 1 -}} {{- $pages = $pages | first $limit -}} {{- end -}} -{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }} +{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <channel> <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title> |