hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit b8af06f26ac0c2daffd76ce5cd6d09deb4ba1783
parent b581bbd8563a7c7ee95f9dcf76850370df4673d2
Author: Vincent Batoufflet <vincent@batoufflet.info>
Date:   Wed,  6 Jul 2016 18:25:59 +0200

Make auto-date disabled by default

Fixes #2244
Closes #2260

Diffstat:
Mcommands/hugo.go | 1+
Mhugolib/page.go | 2+-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/commands/hugo.go b/commands/hugo.go
@@ -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.
diff --git a/hugolib/page.go b/hugolib/page.go
@@ -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()