Skip to content

Commit 577788e

Browse files
committed
fix(rss): RSS feed respects sitemap-disabled pages
1 parent 117881f commit 577788e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

modules/blox/layouts/rss.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{{- /* Upstream Hugo bug - RSS dates can be in future: https://github.com/gohugoio/hugo/issues/3918 */ -}}
33
{{- $page_context := cond .IsHome site . -}}
44
{{- $pages := $page_context.RegularPages -}}
5+
{{- $pages = where $pages "Params.sitemap.disable" "!=" true -}}
56
{{- $limit := site.Config.Services.RSS.Limit -}}
67
{{- if ge $limit 1 -}}
78
{{- $pages = $pages | first $limit -}}
@@ -16,7 +17,7 @@
1617
{{ end -}}
1718
<description>{{ .Title | default site.Title }}</description>
1819
<generator>HugoBlox Kit (https://hugoblox.com)</generator>
19-
{{- with site.Language.Locale }}<language>{{.}}</language>{{end -}}
20+
{{- with site.LanguageCode }}<language>{{.}}</language>{{end -}}
2021
{{- with site.Copyright }}<copyright>{{ strings.ReplacePairs . "{year}" now.Year "&copy;" "©" | plainify }}</copyright>{{end -}}
2122
{{- if not .Date.IsZero }}<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end -}}
2223
{{- if .Scratch.Get "og_image" }}

0 commit comments

Comments
 (0)