mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
Fix "date" page param
Add test coverage for all date type page params that shadow date type page variables. Fixes #4323
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
91bb774ae4
commit
322c567220
@@ -1343,7 +1343,6 @@ func (p *Page) update(frontmatter map[string]interface{}) error {
|
||||
|
||||
if p.Date.IsZero() && p.s.Cfg.GetBool("useModTimeAsFallback") {
|
||||
p.Date = p.Source.FileInfo().ModTime()
|
||||
p.params["date"] = p.Date
|
||||
}
|
||||
|
||||
if p.Lastmod.IsZero() {
|
||||
@@ -1354,6 +1353,8 @@ func (p *Page) update(frontmatter map[string]interface{}) error {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
p.params["date"] = p.Date
|
||||
p.params["lastmod"] = p.Lastmod
|
||||
p.params["publishdate"] = p.PublishDate
|
||||
p.params["expirydate"] = p.ExpiryDate
|
||||
|
Reference in New Issue
Block a user