mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
parent
c21e2b3b4d
commit
eda3678742
1 changed files with 7 additions and 0 deletions
|
@ -663,6 +663,13 @@ func (p *Page) update(f interface{}) error {
|
||||||
p.Draft = !*published
|
p.Draft = !*published
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if p.Date.IsZero() {
|
||||||
|
fi, err := hugofs.Source().Stat(filepath.Join(helpers.AbsPathify(viper.GetString("ContentDir")), p.File.Path()))
|
||||||
|
if err == nil {
|
||||||
|
p.Date = fi.ModTime()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if p.Lastmod.IsZero() {
|
if p.Lastmod.IsZero() {
|
||||||
p.Lastmod = p.Date
|
p.Lastmod = p.Date
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue