create content at any level of nesting

This commit is contained in:
spf13 2013-07-26 09:28:26 -04:00
parent e08d14ad49
commit d5f5543061

View file

@ -414,7 +414,11 @@ func (s *Site) WritePublic(path string, content []byte) {
path, filename := filepath.Split(path)
path = filepath.FromSlash(s.c.GetAbsPath(filepath.Join(s.c.PublishDir, path)))
mkdirIf(path)
err := mkdirIf(path)
if err != nil {
fmt.Println(err)
}
file, _ := os.Create(filepath.Join(path, filename))
defer file.Close()