From 789ef8c639e4621abd36da530bcb5942ac9297da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Sun, 5 Aug 2018 11:13:49 +0200 Subject: Add support for minification of final output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hugo Pipes added minification support for resources fetched via ´resources.Get` and similar. This also adds support for minification of the final output for supported output formats: HTML, XML, SVG, CSS, JavaScript, JSON. To enable, run Hugo with the `--minify` flag: ```bash hugo --minify ``` This commit is also a major spring cleaning of the `transform` package to allow the new minification step fit into that processing chain. Fixes #1251 --- tpl/resources/resources.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tpl') diff --git a/tpl/resources/resources.go b/tpl/resources/resources.go index c9d3275e5..5f375a06b 100644 --- a/tpl/resources/resources.go +++ b/tpl/resources/resources.go @@ -23,7 +23,7 @@ import ( "github.com/gohugoio/hugo/resource/bundler" "github.com/gohugoio/hugo/resource/create" "github.com/gohugoio/hugo/resource/integrity" - "github.com/gohugoio/hugo/resource/minifiers" + "github.com/gohugoio/hugo/resource/minifier" "github.com/gohugoio/hugo/resource/postcss" "github.com/gohugoio/hugo/resource/templates" "github.com/gohugoio/hugo/resource/tocss/scss" @@ -42,7 +42,7 @@ func New(deps *deps.Deps) (*Namespace, error) { createClient: create.New(deps.ResourceSpec), bundlerClient: bundler.New(deps.ResourceSpec), integrityClient: integrity.New(deps.ResourceSpec), - minifyClient: minifiers.New(deps.ResourceSpec), + minifyClient: minifier.New(deps.ResourceSpec), postcssClient: postcss.New(deps.ResourceSpec), templatesClient: templates.New(deps.ResourceSpec, deps.TextTmpl), }, nil @@ -56,7 +56,7 @@ type Namespace struct { bundlerClient *bundler.Client scssClient *scss.Client integrityClient *integrity.Client - minifyClient *minifiers.Client + minifyClient *minifier.Client postcssClient *postcss.Client templatesClient *templates.Client } -- cgit v1.2.3