diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-10-07 11:46:19 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-10-07 11:46:19 +0300 |
commit | 6dd60fca73ff96b48064bb8c6586631a2370ffc6 (patch) | |
tree | 60812553692edf926554e88c1402ed0ad37cb2d6 /minifiers/config.go | |
parent | 138a0259164d3fe417bb8911075cf6d13bc9cd89 (diff) |
Revert "deps: Update to github.com/tdewolff/minify v2.9.4"
Closes #7792
This reverts commit b254532b52785954c98a473a635b9cea016d8565.
Diffstat (limited to 'minifiers/config.go')
-rw-r--r-- | minifiers/config.go | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/minifiers/config.go b/minifiers/config.go index 0715344a7..5ee3aa2f9 100644 --- a/minifiers/config.go +++ b/minifiers/config.go @@ -18,7 +18,6 @@ import ( "github.com/gohugoio/hugo/config" "github.com/gohugoio/hugo/docshelper" "github.com/gohugoio/hugo/parser" - "github.com/spf13/cast" "github.com/mitchellh/mapstructure" "github.com/tdewolff/minify/v2/css" @@ -36,16 +35,18 @@ var defaultTdewolffConfig = tdewolffConfig{ KeepEndTags: true, KeepDefaultAttrVals: true, KeepWhitespace: false, - KeepQuotes: false, + // KeepQuotes: false, >= v2.6.2 }, CSS: css.Minifier{ - Precision: 0, - KeepCSS2: true, + Decimals: -1, // will be deprecated + // Precision: 0, // use Precision with >= v2.7.0 + KeepCSS2: true, }, JS: js.Minifier{}, JSON: json.Minifier{}, SVG: svg.Minifier{ - Precision: 0, + Decimals: -1, // will be deprecated + // Precision: 0, // use Precision with >= v2.7.0 }, XML: xml.Minifier{ KeepWhitespace: false, @@ -98,22 +99,6 @@ func decodeConfig(cfg config.Provider) (conf minifyConfig, err error) { m := maps.ToStringMap(v) - // Handle upstream renames. - if td, found := m["tdewolff"]; found { - tdm := cast.ToStringMap(td) - for _, key := range []string{"css", "svg"} { - if v, found := tdm[key]; found { - vm := cast.ToStringMap(v) - if vv, found := vm["decimal"]; found { - vvi := cast.ToInt(vv) - if vvi > 0 { - vm["precision"] = vvi - } - } - } - } - } - err = mapstructure.WeakDecode(m, &conf) if err != nil { |