Add support for minification of final output
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 5 Aug 2018 09:13:49 +0000 (11:13 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 6 Aug 2018 17:58:41 +0000 (19:58 +0200)
commit789ef8c639e4621abd36da530bcb5942ac9297da
treef225fc3663affc49805f1d309b77b096d40fc8f6
parent71931b30b1813b146aaa60f5cdab16c0f9ebebdb
Add support for minification of final output

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
38 files changed:
commands/commands.go
commands/hugo.go
deps/deps.go
helpers/path.go
hugolib/alias.go
hugolib/hugo_sites.go
hugolib/minify_publisher_test.go [new file with mode: 0644]
hugolib/resource_chain_test.go
hugolib/site.go
hugolib/site_render.go
hugolib/testhelpers_test.go
minifiers/minifiers.go [new file with mode: 0644]
minifiers/minifiers_test.go [new file with mode: 0644]
publisher/publisher.go [new file with mode: 0644]
publisher/publisher_test.go [new file with mode: 0644]
resource/image.go
resource/minifier/minify.go [new file with mode: 0644]
resource/minifiers/minify.go [deleted file]
resource/resource.go
resource/resource_cache.go
resource/testhelpers_test.go
resource/transform.go
tpl/resources/resources.go
transform/absurl.go [deleted file]
transform/absurlreplacer.go [deleted file]
transform/chain.go
transform/chain_test.go
transform/hugogeneratorinject.go [deleted file]
transform/hugogeneratorinject_test.go [deleted file]
transform/livereloadinject.go [deleted file]
transform/livereloadinject/livereloadinject.go [new file with mode: 0644]
transform/livereloadinject/livereloadinject_test.go [new file with mode: 0644]
transform/livereloadinject_test.go [deleted file]
transform/metainject/hugogenerator.go [new file with mode: 0644]
transform/metainject/hugogenerator_test.go [new file with mode: 0644]
transform/urlreplacers/absurl.go [new file with mode: 0644]
transform/urlreplacers/absurlreplacer.go [new file with mode: 0644]
transform/urlreplacers/absurlreplacer_test.go [new file with mode: 0644]