diff options
Diffstat (limited to 'resources/page/pagemeta/page_frontmatter.go')
-rw-r--r-- | resources/page/pagemeta/page_frontmatter.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/resources/page/pagemeta/page_frontmatter.go b/resources/page/pagemeta/page_frontmatter.go index c901ab57b..0e0650934 100644 --- a/resources/page/pagemeta/page_frontmatter.go +++ b/resources/page/pagemeta/page_frontmatter.go @@ -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 { |