mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-29 02:02:09 -05:00
Merge pull request #41 from rozza/skipStatic
Skip Static directory if its in your content directory
This commit is contained in:
commit
2542836bbc
1 changed files with 5 additions and 1 deletions
|
@ -194,6 +194,8 @@ func (s *Site) initialize() {
|
|||
|
||||
s.checkDirectories()
|
||||
|
||||
staticDir := s.Config.GetAbsPath(s.Config.StaticDir+"/")
|
||||
|
||||
walker := func(path string, fi os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
PrintErr("Walker: ", err)
|
||||
|
@ -201,6 +203,9 @@ func (s *Site) initialize() {
|
|||
}
|
||||
|
||||
if fi.IsDir() {
|
||||
if (path == staticDir) {
|
||||
return filepath.SkipDir
|
||||
}
|
||||
site.Directories = append(site.Directories, path)
|
||||
return nil
|
||||
} else {
|
||||
|
@ -213,7 +218,6 @@ func (s *Site) initialize() {
|
|||
}
|
||||
|
||||
filepath.Walk(s.absContentDir(), walker)
|
||||
|
||||
s.Info = SiteInfo{
|
||||
BaseUrl: template.URL(s.Config.BaseUrl),
|
||||
Title: s.Config.Title,
|
||||
|
|
Loading…
Reference in a new issue