-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RSS template has incorrect value for lastBuildDate #11600
Comments
Yes, we should change this, but use
Please submit PR. |
Ah thanks, I misread the collections.Index docs. Will do. |
I found another RSS template, which is for the Hugo docs site. This has the same bug. I propose factoring out the expression in line 20 so the first line of the template is: {{- $pages := first 50 (where .Site.RegularPages "Type" "in" (slice "news" "showcase")) -}} then use the same WDYT? |
I think you should focus on the original issue, and raise a separate issue in the docs repository. |
Ok will do. I'm getting test failures on a fresh checkout. I've asked for help but nothing yet. I'm pretty sure this change won't make things any worse, but I have an allergic reaction to checking in code with broken tests! |
Set the `<lastBuildDate>` field to be the most recent Lastmod date of all the posts in the current selection. Fixes gohugoio#11600
Fixes gohugoio#11600 Co-authored-by: Joe Mooring <joe@mooring.com>
Set the `<lastBuildDate>` field to be the most recent Lastmod date of all the posts in the current selection. Fixes #11600
Fixes #11600 Co-authored-by: Joe Mooring <joe@mooring.com>
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
Yes
Steps to reproduce
hugo
command/index.xml
fileDescription
In Hugo 0.119, the internal RSS template has a
<lastBuildDate>
field based on.Date
, which is the date in the site's top-level_index.md
file (or the_index.md
file for the section or category for sub-feeds, I presume).Instead it should either be the date the RSS file was built or the date of the most recent published post, so RSS readers can tell whether anything has changed.
I am doing the latter in the following fragment, in a custom
/layouts/rss.xml
template based on the internal one:I am happy to submit a PR with this change. I can't see it breaking anything except for the case where
$pages
is empty.Using the current build time is even easier:
I prefer the most recent post date; it feels more RSS-like. The main thing is that the current
/index.xml
bases the date on/_index.md
, which in my case is August 2013!The text was updated successfully, but these errors were encountered: