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:
Vas Sudanagunta
2018-01-25 23:03:55 -05:00
committed by Bjørn Erik Pedersen
parent 91bb774ae4
commit 322c567220
2 changed files with 10 additions and 5 deletions

View File

@@ -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