mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-26 14:42:15 +00:00
parent
be09781af1
commit
7615ef0c28
1 changed files with 9 additions and 3 deletions
|
@ -136,13 +136,19 @@ func convertContents(mark rune) (err error) {
|
||||||
|
|
||||||
page.SetDir(filepath.Join(helpers.AbsPathify(viper.GetString("ContentDir")), file.Dir()))
|
page.SetDir(filepath.Join(helpers.AbsPathify(viper.GetString("ContentDir")), file.Dir()))
|
||||||
page.SetSourceContent(psr.Content())
|
page.SetSourceContent(psr.Content())
|
||||||
page.SetSourceMetaData(metadata, mark)
|
if err = page.SetSourceMetaData(metadata, mark); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
if outputDir != "" {
|
if outputDir != "" {
|
||||||
page.SaveSourceAs(filepath.Join(outputDir, page.FullFilePath()))
|
if err = page.SaveSourceAs(filepath.Join(outputDir, page.FullFilePath())); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if unsafe {
|
if unsafe {
|
||||||
page.SaveSource()
|
if err = page.SaveSource(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
jww.FEEDBACK.Println("Unsafe operation not allowed, use --unsafe or set a different output path")
|
jww.FEEDBACK.Println("Unsafe operation not allowed, use --unsafe or set a different output path")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue