Skip to content

Commit

Permalink
import: Fix importing jekyll site
Browse files Browse the repository at this point in the history
Just use `afero.OsFs` without building site.
Close #9817
  • Loading branch information
satotake authored and bep committed May 21, 2022
1 parent e164834 commit 2fc2e9c
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions commands/import_jekyll.go
Expand Up @@ -36,7 +36,6 @@ import (
"github.com/gohugoio/hugo/common/maps"
"github.com/gohugoio/hugo/helpers"
"github.com/gohugoio/hugo/hugofs"
"github.com/gohugoio/hugo/hugolib"
"github.com/gohugoio/hugo/parser"
"github.com/spf13/afero"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -202,12 +201,7 @@ func (i *importCmd) retrieveJekyllPostDir(fs afero.Fs, dir string) (bool, bool)
}

func (i *importCmd) createSiteFromJekyll(jekyllRoot, targetDir string, jekyllPostDirs map[string]bool, force bool) error {
s, err := hugolib.NewSiteDefaultLang()
if err != nil {
return err
}

fs := s.Fs.Source
fs := &afero.OsFs{}
if exists, _ := helpers.Exists(targetDir, fs); exists {
if isDir, _ := helpers.IsDir(targetDir, fs); !isDir {
return errors.New("target path \"" + targetDir + "\" exists but is not a directory")
Expand Down

0 comments on commit 2fc2e9c

Please sign in to comment.