mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 20:15:25 +00:00
fix: Hugo v0.58.0 breaks RSS template
In Hugo v0.58, Hugo team made a breaking change to fix .Data.Pages to actually show home pages when on homepage. Previously, the function returned all of the site's pages. Hence this PR adds compatibility for RSS feeds in Hugo v0.58.0+. Fix #1355
This commit is contained in:
1 parent
829995656e
commit
904fd88714
2 files changed
+3
-2
No files matched your search
@@ -1,6 +1,7 @@
|
||||
{{- /* Generate RSS v2 with full page content. */ -}}
|
||||
{{- /* Upstream Hugo bug - RSS dates can be in future: https://github.com/gohugoio/hugo/issues/3918 */ -}}
|
||||
{{- $pages := .Data.Pages -}}
|
||||
{{- $page_context := cond .IsHome site . -}}
|
||||
{{- $pages := $page_context.RegularPages -}}
|
||||
{{- $limit := site.Config.Services.RSS.Limit -}}
|
||||
{{- if ge $limit 1 -}}
|
||||
{{- $pages = $pages | first $limit -}}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
[build.environment]
|
||||
HUGO_THEME = "repo"
|
||||
HUGO_VERSION = "0.58.1"
|
||||
HUGO_VERSION = "0.58.3"
|
||||
HUGO_ENABLEGITINFO = "true"
|
||||
|
||||
[context.production.environment]
|
||||
|
||||
Reference in new issue
Block a user