mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-28 22:19:59 +02:00
Add page metadata dates tests
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
ae5a45be6f
commit
3f0379adb7
@@ -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() {
|
||||
|
Reference in New Issue
Block a user