Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/filesystem.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/filesystem.go b/source/filesystem.go
index d30eea8da..4565c7f48 100644
--- a/source/filesystem.go
+++ b/source/filesystem.go
@@ -15,10 +15,12 @@ package source
import (
"bytes"
+ "github.com/spf13/viper"
"io"
"io/ioutil"
"os"
"path/filepath"
+ "regexp"
"strings"
"github.com/spf13/hugo/helpers"
@@ -146,5 +148,14 @@ func isNonProcessablePath(filePath string) bool {
return true
}
+ ignoreFiles := viper.GetStringSlice("WatchIgnoreFiles")
+ if len(ignoreFiles) > 0 {
+ for _, ignorePattern := range ignoreFiles {
+ match, _ := regexp.MatchString(ignorePattern, filePath)
+ if match {
+ return true
+ }
+ }
+ }
return false
}