mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-11 20:03:58 +02:00
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:
@@ -22,6 +22,8 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/gohugoio/hugo/common/paths"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/gohugoio/hugo/resources/images/exif"
|
||||
@@ -136,13 +138,13 @@ func (ctx *ResourceTransformationCtx) PublishSourceMap(content string) error {
|
||||
// extension, e.g. ".scss"
|
||||
func (ctx *ResourceTransformationCtx) ReplaceOutPathExtension(newExt string) {
|
||||
dir, file := path.Split(ctx.InPath)
|
||||
base, _ := helpers.PathAndExt(file)
|
||||
base, _ := paths.PathAndExt(file)
|
||||
ctx.OutPath = path.Join(dir, (base + newExt))
|
||||
}
|
||||
|
||||
func (ctx *ResourceTransformationCtx) addPathIdentifier(inPath, identifier string) string {
|
||||
dir, file := path.Split(inPath)
|
||||
base, ext := helpers.PathAndExt(file)
|
||||
base, ext := paths.PathAndExt(file)
|
||||
return path.Join(dir, (base + identifier + ext))
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user