Add --force to hugo new

Closes #9243
This commit is contained in:
satotake
2022-09-01 00:23:31 +09:00
committed by Bjørn Erik Pedersen
parent 02c89a446d
commit 7d40da876c
5 changed files with 50 additions and 16 deletions

View File

@@ -43,7 +43,7 @@ Hello World.
`)
b.CreateSites()
cf := NewContentFactory(b.H)
abs, err := cf.CreateContentPlaceHolder(filepath.FromSlash("mcontent/en/blog/mypage.md"))
abs, err := cf.CreateContentPlaceHolder(filepath.FromSlash("mcontent/en/blog/mypage.md"), false)
b.Assert(err, qt.IsNil)
b.Assert(abs, qt.Equals, filepath.FromSlash("/my/work/mcontent/en/blog/mypage.md"))
b.Build(BuildCfg{SkipRender: true})
@@ -69,7 +69,7 @@ theme = 'ipsum'
b.WithSourceFile(filepath.Join(themeDir, "content/posts/foo.txt"), `Hello.`)
b.CreateSites()
cf := NewContentFactory(b.H)
abs, err := cf.CreateContentPlaceHolder(filepath.FromSlash("posts/test.md"))
abs, err := cf.CreateContentPlaceHolder(filepath.FromSlash("posts/test.md"), false)
b.Assert(err, qt.IsNil)
b.Assert(abs, qt.Equals, filepath.FromSlash("content/posts/test.md"))