mirror of
https://github.com/gohugoio/hugo.git
synced 2025-09-01 22:42:45 +02:00
committed by
Bjørn Erik Pedersen
parent
02c89a446d
commit
7d40da876c
@@ -110,7 +110,7 @@ func (f ContentFactory) SectionFromFilename(filename string) (string, error) {
|
||||
|
||||
// CreateContentPlaceHolder creates a content placeholder file inside the
|
||||
// best matching content directory.
|
||||
func (f ContentFactory) CreateContentPlaceHolder(filename string) (string, error) {
|
||||
func (f ContentFactory) CreateContentPlaceHolder(filename string, force bool) (string, error) {
|
||||
filename = filepath.Clean(filename)
|
||||
_, abs, err := f.h.AbsProjectContentDir(filename)
|
||||
|
||||
@@ -130,6 +130,9 @@ _build:
|
||||
|
||||
`
|
||||
|
||||
if force {
|
||||
return abs, afero.WriteReader(f.h.Fs.Source, abs, strings.NewReader(placeholder))
|
||||
}
|
||||
return abs, afero.SafeWriteReader(f.h.Fs.Source, abs, strings.NewReader(placeholder))
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user