]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
import: Fix importing jekyll site
authorsatotake <doublequotation@gmail.com>
Sat, 21 May 2022 18:41:28 +0000 (03:41 +0900)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 21 May 2022 21:44:40 +0000 (23:44 +0200)
Just use `afero.OsFs` without building site.
Close #9817

commands/import_jekyll.go

index 232df519c12b60c7ad4c35ae2f57ab15bfa40a18..91d5c69fe5444514b1e9f482b7f3837e96e52feb 100644 (file)
@@ -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"
@@ -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")