mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-25 15:01:27 +00: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("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()
|
||||
|
|
Loading…
Reference in a new issue