Split out the puthe path/filepath functions into common/paths

So they can be used from the config package without cyclic troubles.

Updates #8654
This commit is contained in:
Bjørn Erik Pedersen
2021-06-18 10:27:27 +02:00
parent 5af045ebab
commit 93aad3c543
21 changed files with 956 additions and 591 deletions

View File

@@ -21,6 +21,8 @@ import (
"path/filepath"
"strings"
"github.com/gohugoio/hugo/common/paths"
"github.com/pkg/errors"
"github.com/gohugoio/hugo/common/hexec"
@@ -39,7 +41,7 @@ import (
func NewContent(
sites *hugolib.HugoSites, kind, targetPath string) error {
targetPath = filepath.Clean(targetPath)
ext := helpers.Ext(targetPath)
ext := paths.Ext(targetPath)
ps := sites.PathSpec
archetypeFs := ps.BaseFs.SourceFilesystems.Archetypes.Fs
sourceFs := ps.Fs.Source