mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
parent
a6f199f7a6
commit
c81fbf4625
1 changed files with 2 additions and 0 deletions
|
@ -18,6 +18,7 @@ package minifiers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
|
"regexp"
|
||||||
|
|
||||||
"github.com/gohugoio/hugo/output"
|
"github.com/gohugoio/hugo/output"
|
||||||
"github.com/gohugoio/hugo/transform"
|
"github.com/gohugoio/hugo/transform"
|
||||||
|
@ -70,6 +71,7 @@ func New(mediaTypes media.Types, outputFormats output.Formats) Client {
|
||||||
// We use the Type definition of the media types defined in the site if found.
|
// We use the Type definition of the media types defined in the site if found.
|
||||||
addMinifierFunc(m, mediaTypes, "text/css", "css", css.Minify)
|
addMinifierFunc(m, mediaTypes, "text/css", "css", css.Minify)
|
||||||
addMinifierFunc(m, mediaTypes, "application/javascript", "js", js.Minify)
|
addMinifierFunc(m, mediaTypes, "application/javascript", "js", js.Minify)
|
||||||
|
m.AddFuncRegexp(regexp.MustCompile("^(application|text)/(x-)?(java|ecma)script$"), js.Minify)
|
||||||
addMinifierFunc(m, mediaTypes, "application/json", "json", json.Minify)
|
addMinifierFunc(m, mediaTypes, "application/json", "json", json.Minify)
|
||||||
addMinifierFunc(m, mediaTypes, "image/svg+xml", "svg", svg.Minify)
|
addMinifierFunc(m, mediaTypes, "image/svg+xml", "svg", svg.Minify)
|
||||||
addMinifierFunc(m, mediaTypes, "application/xml", "xml", xml.Minify)
|
addMinifierFunc(m, mediaTypes, "application/xml", "xml", xml.Minify)
|
||||||
|
|
Loading…
Reference in a new issue