Add page metadata dates tests

This commit is contained in:
Vas Sudanagunta
2018-01-24 09:21:55 -05:00
committed by Bjørn Erik Pedersen
parent ae5a45be6f
commit 3f0379adb7
2 changed files with 161 additions and 7 deletions

View File

@@ -1343,11 +1343,8 @@ func (p *Page) update(f interface{}) error {
}
if p.Date.IsZero() && p.s.Cfg.GetBool("useModTimeAsFallback") {
fi, err := p.s.Fs.Source.Stat(filepath.Join(p.s.PathSpec.AbsPathify(p.s.Cfg.GetString("contentDir")), p.File.Path()))
if err == nil {
p.Date = fi.ModTime()
p.params["date"] = p.Date
}
p.Date = p.Source.FileInfo().ModTime()
p.params["date"] = p.Date
}
if p.Lastmod.IsZero() {