Fix invalid timestamp of the "public" folder
authorAnthony Fok <foka@debian.org>
Sat, 29 May 2021 03:35:48 +0000 (21:35 -0600)
committerAnthony Fok <foka@debian.org>
Fri, 4 Jun 2021 20:50:30 +0000 (14:50 -0600)
Special thanks to both Richard Mortimer (@oldelvet) and
Joshua M. Clulow (@jclulow) for their analysis and suggested fix:

 * https://github.com/gohugoio/hugo/issues/6161#issuecomment-574336088
 * https://github.com/gohugoio/hugo/issues/6161#issuecomment-596805273

Fixes #6161

hugofs/fileinfo.go

index d68321282aa5108d2667ad5005de7debf6d1e13b..17fb62ea2268dfc5752064d6bc141cbc38689b1f 100644 (file)
@@ -280,7 +280,7 @@ func (fi *dirNameOnlyFileInfo) Mode() os.FileMode {
 }
 
 func (fi *dirNameOnlyFileInfo) ModTime() time.Time {
-       return time.Time{}
+       return time.Now()
 }
 
 func (fi *dirNameOnlyFileInfo) IsDir() bool {