mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
Fix it so publishDate rolls up to section, taxonomy, or term pages
Fixes #12438
This commit is contained in:
@@ -57,13 +57,17 @@ func (d Dates) IsDateOrLastModAfter(in Dates) bool {
|
||||
return d.Date.After(in.Date) || d.Lastmod.After(in.Lastmod)
|
||||
}
|
||||
|
||||
func (d *Dates) UpdateDateAndLastmodIfAfter(in Dates) {
|
||||
func (d *Dates) UpdateDateAndLastmodAndPublishDateIfAfter(in Dates) {
|
||||
if in.Date.After(d.Date) {
|
||||
d.Date = in.Date
|
||||
}
|
||||
if in.Lastmod.After(d.Lastmod) {
|
||||
d.Lastmod = in.Lastmod
|
||||
}
|
||||
|
||||
if in.PublishDate.After(d.PublishDate) && in.PublishDate.Before(htime.Now()) {
|
||||
d.PublishDate = in.PublishDate
|
||||
}
|
||||
}
|
||||
|
||||
func (d Dates) IsAllDatesZero() bool {
|
||||
|
Reference in New Issue
Block a user