Skip "dot" files in layout
authorNoah Campbell <noahcampbell@gmail.com>
Fri, 23 Aug 2013 20:51:59 +0000 (13:51 -0700)
committerNoah Campbell <noahcampbell@gmail.com>
Fri, 23 Aug 2013 20:58:52 +0000 (13:58 -0700)
As a vim user, .filename.swp files pop up.  This change prevents hugo
from reading those files.

hugolib/site.go

index d6cd343cd2ecdde14eb18470ec94690a56208ace..a64475216f8099227a8c445f7948ee35506f0513 100644 (file)
@@ -163,6 +163,9 @@ func (s *Site) loadTemplates() {
                }
 
                if !fi.IsDir() {
+                       if ignoreDotFile(path) {
+                               return nil
+                       }
                        filetext, err := ioutil.ReadFile(path)
                        if err != nil {
                                return err