diff options
author | Ross Lawley <ross.lawley@gmail.com> | 2013-08-15 19:58:34 +0100 |
---|---|---|
committer | Ross Lawley <ross.lawley@gmail.com> | 2013-08-15 20:05:46 +0100 |
commit | 0f143dcf1498897d2f7b83fad6830fd964b3ef95 (patch) | |
tree | 6d73918850e567e73c3fc4585769c14f45a606a5 | |
parent | 3c3fc45d3c34a7dcd1a0e9fd2636e7a5c5933e03 (diff) |
Skip Static directory if its in your content directory
Allows organisation where all source files are in one directory:
```
`config.yaml`:
contentdir: "source"
staticdir: "source/static"
...
.
└── source
├── post
| ├── firstpost.md // <- http://site.com/post/firstpost.html
| └── secondpost.md // <- http://site.com/post/secondpost.html
└── static
└── css
└── site.css // <- http://site.com/css/site.css
```
-rw-r--r-- | hugolib/site.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/hugolib/site.go b/hugolib/site.go index c0bce9f06..45c461303 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -192,6 +192,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) @@ -199,6 +201,9 @@ func (s *Site) initialize() { } if fi.IsDir() { + if (path == staticDir) { + return filepath.SkipDir + } site.Directories = append(site.Directories, path) return nil } else { @@ -211,7 +216,6 @@ func (s *Site) initialize() { } filepath.Walk(s.absContentDir(), walker) - s.Info = SiteInfo{ BaseUrl: template.URL(s.Config.BaseUrl), Title: s.Config.Title, |