diff options
author | Chen Xianmin <xianmin12@gmail.com> | 2019-11-23 09:36:50 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-23 09:36:50 +0300 |
commit | 9717806fca0258174c772ab3a34d7059c9c0a459 (patch) | |
tree | 431b9488689d29f7616f7e9e643b63f304e0b8a3 | |
parent | 862b806512d2d1a43893be6cbb64746d3b037416 (diff) | |
parent | 35f6be96fdcf7325b43c80cf0b9dac1ca06eeafb (diff) |
Merge pull request #267 from PhilRW/rss-fix
Fix RSS
-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> |