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

@@ -28,6 +28,8 @@ import (
"testing"
"time"
"github.com/gohugoio/hugo/common/paths"
"github.com/spf13/afero"
"github.com/disintegration/gift"
@@ -145,7 +147,7 @@ func TestImageTransformFormat(t *testing.T) {
assertExtWidthHeight := func(img resource.Image, ext string, w, h int) {
c.Helper()
c.Assert(img, qt.Not(qt.IsNil))
c.Assert(helpers.Ext(img.RelPermalink()), qt.Equals, ext)
c.Assert(paths.Ext(img.RelPermalink()), qt.Equals, ext)
c.Assert(img.Width(), qt.Equals, w)
c.Assert(img.Height(), qt.Equals, h)
}