mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
committed by
Bjørn Erik Pedersen
parent
b581bbd856
commit
b8af06f26a
@@ -315,6 +315,7 @@ func loadDefaultSettings() {
|
||||
viper.SetDefault("HasCJKLanguage", false)
|
||||
viper.SetDefault("EnableEmoji", false)
|
||||
viper.SetDefault("PygmentsCodeFencesGuessSyntax", false)
|
||||
viper.SetDefault("UseModTimeAsFallback", false)
|
||||
}
|
||||
|
||||
// InitializeConfig initializes a config file with sensible default configuration flags.
|
||||
|
@@ -663,7 +663,7 @@ func (p *Page) update(f interface{}) error {
|
||||
p.Draft = !*published
|
||||
}
|
||||
|
||||
if p.Date.IsZero() {
|
||||
if p.Date.IsZero() && viper.GetBool("UseModTimeAsFallback") {
|
||||
fi, err := hugofs.Source().Stat(filepath.Join(helpers.AbsPathify(viper.GetString("ContentDir")), p.File.Path()))
|
||||
if err == nil {
|
||||
p.Date = fi.ModTime()
|
||||
|
Reference in New Issue
Block a user