mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-15 20:44:01 +02:00
resources/js: Simplify options handling
Mostly to minify cache hash breakage. Updates #7499
This commit is contained in:
11
tpl/js/js.go
11
tpl/js/js.go
@@ -16,7 +16,6 @@ package js
|
||||
|
||||
import (
|
||||
"github.com/gohugoio/hugo/deps"
|
||||
"github.com/gohugoio/hugo/helpers"
|
||||
"github.com/gohugoio/hugo/resources"
|
||||
"github.com/gohugoio/hugo/resources/resource"
|
||||
"github.com/gohugoio/hugo/resources/resource_transformers/js"
|
||||
@@ -58,16 +57,10 @@ func (ns *Namespace) Build(args ...interface{}) (resource.Resource, error) {
|
||||
}
|
||||
}
|
||||
|
||||
var options js.Options
|
||||
if targetPath != "" {
|
||||
options.TargetPath = helpers.ToSlashTrimLeading(targetPath)
|
||||
} else if m != nil {
|
||||
options, err = js.DecodeOptions(m)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
m = map[string]interface{}{"targetPath": targetPath}
|
||||
}
|
||||
|
||||
return ns.client.Process(r, options)
|
||||
return ns.client.Process(r, m)
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user