-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
List page publish date now defaults to that of the latest subpage #12653
Comments
See #12438 |
@bep Also, if the ultimate decision is to not revert the .PublishDate behavior, then we should follow through and fix the .PublishDate documentation to reflect the current behavior:
|
The above is still correct. If you add The current behaviour matches how we treat both date and lastMod and is what most people would expect. If you don't want to show |
But it's incorrect if no date-like params are set. For other page kinds, if no date-like params are set, then .PublishDate is time.Time{}. That isn't the case for list pages. This special list page behavior is unspecified here and elsewhere.
I do want to show it if a date-like param is set, according to the configured fallbacks. As I pointed out above, there's currently no portable way to do this.
Then my argument should apply to them too. That does admittedly increase the scope of change. If you don't want to make breaking changes (again) like that, then I understand, but then how about a new field that implements the previous behavior? Something like PAGE.PublishDateNotRecursive (similar to PAGE.RegularPagesRecursive)? (Edited) |
I see all my list pages have a value defined for PAGE.PublishDate when there shouldn't be any. This seems to have changed in a recent version, but I don't know which.
Repro for a new/blank site:
layouts/_default/list.html:
layouts/_default/single.html:
content/_index.md:
content/foo.md:
http://localhost:1313/foo/ content:
Expected http://localhost:1313 content:
Actual http://localhost:1313 content:
This change appears to have been part of a bug fix: #12438
I would argue that the previous behavior (where PAGE.PublishDate worked like every other page kind) is better because:
First reported at https://discourse.gohugo.io/t/list-page-publish-date-now-defaults-to-that-of-the-latest-subpage/50634.
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
Yes.
The text was updated successfully, but these errors were encountered: