Add resources.Match and resources.GetMatch

Fix #6190
This commit is contained in:
Bjørn Erik Pedersen
2019-08-12 16:43:37 +02:00
parent 17ca8f0c4c
commit b64617fe4f
10 changed files with 407 additions and 19 deletions

View File

@@ -17,7 +17,7 @@ import (
"fmt"
"strconv"
"github.com/gohugoio/hugo/resources/internal"
"github.com/gohugoio/hugo/hugofs/glob"
"github.com/gohugoio/hugo/resources/resource"
"github.com/pkg/errors"
@@ -70,7 +70,7 @@ func AssignMetadata(metadata []map[string]interface{}, resources ...resource.Res
srcKey := strings.ToLower(cast.ToString(src))
glob, err := internal.GetGlob(srcKey)
glob, err := glob.GetGlob(srcKey)
if err != nil {
return errors.Wrap(err, "failed to match resource with metadata")
}