mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
create content at any level of nesting
This commit is contained in:
parent
e08d14ad49
commit
d5f5543061
1 changed files with 5 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue