diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-07-21 17:03:06 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-07-22 10:13:30 +0200 |
commit | eded9ac2a05b9a7244c25c70ca8f761b69b33385 (patch) | |
tree | 34da39c5ab42d9ca6e62c57297f31c237f5aee90 /tpl/js | |
parent | 8d72512825b4cee12dc1952004f48fd076a3517b (diff) |
resources/js: Simplify options handling
Mostly to minify cache hash breakage.
Updates #7499
Diffstat (limited to 'tpl/js')
-rw-r--r-- | tpl/js/js.go | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/tpl/js/js.go b/tpl/js/js.go index 2232d8be7..b7a2fe066 100644 --- a/tpl/js/js.go +++ b/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) } |