mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
parent
096f5e1921
commit
e02e0727e5
1 changed files with 1 additions and 10 deletions
|
@ -113,11 +113,6 @@ func (f ContentFactory) CreateContentPlaceHolder(filename string) (string, error
|
||||||
filename = filepath.Clean(filename)
|
filename = filepath.Clean(filename)
|
||||||
_, abs := f.h.AbsProjectContentDir(filename)
|
_, abs := f.h.AbsProjectContentDir(filename)
|
||||||
|
|
||||||
contentDir := filepath.Dir(abs)
|
|
||||||
if err := f.h.Fs.Source.MkdirAll(contentDir, 0777); err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
|
|
||||||
// This will be overwritten later, just write a placholder to get
|
// This will be overwritten later, just write a placholder to get
|
||||||
// the paths correct.
|
// the paths correct.
|
||||||
placeholder := `---
|
placeholder := `---
|
||||||
|
@ -130,11 +125,7 @@ _build:
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
if err := afero.WriteFile(f.h.Fs.Source, abs, []byte(placeholder), 0777); err != nil {
|
return abs, afero.SafeWriteReader(f.h.Fs.Source, abs, strings.NewReader(placeholder))
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
|
|
||||||
return abs, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewContentFactory creates a new ContentFactory for h.
|
// NewContentFactory creates a new ContentFactory for h.
|
||||||
|
|
Loading…
Reference in a new issue