mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
parent
a04abf0dda
commit
8d040c966f
1 changed files with 3 additions and 3 deletions
|
@ -137,17 +137,17 @@ 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())
|
||||||
if err = page.SetSourceMetaData(metadata, mark); err != nil {
|
if err = page.SetSourceMetaData(metadata, mark); err != nil {
|
||||||
return err
|
return fmt.Errorf("Failed to set source metadata for file %q: %s", page.FullFilePath(), err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if outputDir != "" {
|
if outputDir != "" {
|
||||||
if err = page.SaveSourceAs(filepath.Join(outputDir, page.FullFilePath())); err != nil {
|
if err = page.SaveSourceAs(filepath.Join(outputDir, page.FullFilePath())); err != nil {
|
||||||
return err
|
return fmt.Errorf("Failed to save file %q: %s", page.FullFilePath(), err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if unsafe {
|
if unsafe {
|
||||||
if err = page.SaveSource(); err != nil {
|
if err = page.SaveSource(); err != nil {
|
||||||
return err
|
return fmt.Errorf("Failed to save file %q: %s", page.FullFilePath(), 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