summaryrefslogtreecommitdiffstats
path: root/commands/convert.go
diff options
context:
space:
mode:
authorbep <bjorn.erik.pedersen@gmail.com>2014-11-17 23:18:40 +0100
committerspf13 <steve.francia@gmail.com>2014-11-18 10:17:01 -0500
commitcb3576b6de99a7a90b50d7d910f23d2c13297e7e (patch)
treec6b6e624450f40b0e458e44df27a1b1d923f612f /commands/convert.go
parentbcaf33418f041aca794d218f0393004ed4703f1b (diff)
Fix broken convert
The front matter convert-feature didn't work. It placed converted content in the wrong directory. This commit fixes this by doing the smallest and safest change possible; the path logic here should maybe be revisited and generalized. Fixes #643
Diffstat (limited to 'commands/convert.go')
-rw-r--r--commands/convert.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/commands/convert.go b/commands/convert.go
index 2aa6da9dd..01feecb2d 100644
--- a/commands/convert.go
+++ b/commands/convert.go
@@ -15,14 +15,15 @@ package commands
import (
"fmt"
- "path/filepath"
- "time"
-
"github.com/spf13/cast"
"github.com/spf13/cobra"
+ "github.com/spf13/hugo/helpers"
"github.com/spf13/hugo/hugolib"
"github.com/spf13/hugo/parser"
jww "github.com/spf13/jwalterweatherman"
+ "github.com/spf13/viper"
+ "path/filepath"
+ "time"
)
var OutputDir string
@@ -128,7 +129,7 @@ func convertContents(mark rune) (err error) {
metadata = newmetadata
}
- //page.Dir = file.Dir
+ page.SetDir(filepath.Join(helpers.AbsPathify(viper.GetString("ContentDir")), file.Dir()))
page.SetSourceContent(psr.Content())
page.SetSourceMetaData(metadata, mark)