mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
parent
b581bbd856
commit
b8af06f26a
2 changed files with 2 additions and 1 deletions
|
@ -315,6 +315,7 @@ func loadDefaultSettings() {
|
||||||
viper.SetDefault("HasCJKLanguage", false)
|
viper.SetDefault("HasCJKLanguage", false)
|
||||||
viper.SetDefault("EnableEmoji", false)
|
viper.SetDefault("EnableEmoji", false)
|
||||||
viper.SetDefault("PygmentsCodeFencesGuessSyntax", false)
|
viper.SetDefault("PygmentsCodeFencesGuessSyntax", false)
|
||||||
|
viper.SetDefault("UseModTimeAsFallback", false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// InitializeConfig initializes a config file with sensible default configuration flags.
|
// InitializeConfig initializes a config file with sensible default configuration flags.
|
||||||
|
|
|
@ -663,7 +663,7 @@ func (p *Page) update(f interface{}) error {
|
||||||
p.Draft = !*published
|
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()))
|
fi, err := hugofs.Source().Stat(filepath.Join(helpers.AbsPathify(viper.GetString("ContentDir")), p.File.Path()))
|
||||||
if err == nil {
|
if err == nil {
|
||||||
p.Date = fi.ModTime()
|
p.Date = fi.ModTime()
|
||||||
|
|
Loading…
Reference in a new issue