summaryrefslogtreecommitdiffstats
path: root/hugolib/config.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-06-18 10:27:27 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-06-18 10:55:00 +0200
commit93aad3c543828efca2adeb7f96cf50ae29878593 (patch)
tree6a3dd4f6f878f8f36be9cef03a15b78b19d1f3da /hugolib/config.go
parent5af045ebab109d3e5501b8b6d9fd448840c96c9a (diff)
Split out the puthe path/filepath functions into common/paths
So they can be used from the config package without cyclic troubles. Updates #8654
Diffstat (limited to 'hugolib/config.go')
-rw-r--r--hugolib/config.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/hugolib/config.go b/hugolib/config.go
index deba8abe6..091827660 100644
--- a/hugolib/config.go
+++ b/hugolib/config.go
@@ -21,6 +21,7 @@ import (
"github.com/gohugoio/hugo/common/types"
"github.com/gohugoio/hugo/common/maps"
+ cpaths "github.com/gohugoio/hugo/common/paths"
"github.com/gobwas/glob"
hglob "github.com/gohugoio/hugo/hugofs/glob"
@@ -436,7 +437,7 @@ func (l configLoader) loadConfig(configName string) (string, error) {
}
var filename string
- if helpers.ExtNoDelimiter(configName) != "" {
+ if cpaths.ExtNoDelimiter(configName) != "" {
exists, _ := helpers.Exists(baseFilename, l.Fs)
if exists {
filename = baseFilename
@@ -509,7 +510,7 @@ func (l configLoader) loadConfigFromConfigDir() ([]string, error) {
return nil
}
- name := helpers.Filename(filepath.Base(path))
+ name := cpaths.Filename(filepath.Base(path))
item, err := metadecoders.Default.UnmarshalFileToMap(sourceFs, path)
if err != nil {
@@ -520,7 +521,7 @@ func (l configLoader) loadConfigFromConfigDir() ([]string, error) {
if name != "config" {
// Can be params.jp, menus.en etc.
- name, lang := helpers.FileAndExtNoDelimiter(name)
+ name, lang := cpaths.FileAndExtNoDelimiter(name)
keyPath = []string{name}