Merge pull request #41 from rozza/skipStatic

Skip Static directory if its in your content directory
This commit is contained in:
Steve Francia 2013-08-17 20:59:07 -07:00
commit 2542836bbc

View file

@ -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,