Skip to content

Commit

Permalink
Fix broken convert
Browse files Browse the repository at this point in the history
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 gohugoio#643
  • Loading branch information
bep authored and spf13 committed Nov 18, 2014
1 parent bcaf334 commit cb3576b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions commands/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions source/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ func (f *File) LogicalName() string {
}
}

//func (f *File) SetDir(dir string) {
//f.dir = dir
//}
func (f *File) SetDir(dir string) {
f.dir = dir
}

func (f *File) Dir() string {
if f.dir != "" {
Expand Down

0 comments on commit cb3576b

Please sign in to comment.