mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00:00
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
This commit is contained in:
@ -15,14 +15,15 @@ package commands
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"path/filepath"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/spf13/cast"
|
"github.com/spf13/cast"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
"github.com/spf13/hugo/helpers"
|
||||||
"github.com/spf13/hugo/hugolib"
|
"github.com/spf13/hugo/hugolib"
|
||||||
"github.com/spf13/hugo/parser"
|
"github.com/spf13/hugo/parser"
|
||||||
jww "github.com/spf13/jwalterweatherman"
|
jww "github.com/spf13/jwalterweatherman"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
"path/filepath"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
var OutputDir string
|
var OutputDir string
|
||||||
@ -128,7 +129,7 @@ func convertContents(mark rune) (err error) {
|
|||||||
metadata = newmetadata
|
metadata = newmetadata
|
||||||
}
|
}
|
||||||
|
|
||||||
//page.Dir = 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)
|
page.SetSourceMetaData(metadata, mark)
|
||||||
|
|
||||||
|
@ -70,9 +70,9 @@ func (f *File) LogicalName() string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//func (f *File) SetDir(dir string) {
|
func (f *File) SetDir(dir string) {
|
||||||
//f.dir = dir
|
f.dir = dir
|
||||||
//}
|
}
|
||||||
|
|
||||||
func (f *File) Dir() string {
|
func (f *File) Dir() string {
|
||||||
if f.dir != "" {
|
if f.dir != "" {
|
||||||
|
Reference in New Issue
Block a user