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
As pointed out by the linter, some exported functions and types are
missing doc comments.
The linter warnings have been reduced from 194 to 116.
Not all missing comments have been added in this commit though.
If hugo server is run on port 80 or 443, LiveReload does not
correctly bind to the same port, instead using port 35729.
This commit adds functionality to inform LiveReload of the
correct port to bind to.
See https://github.com/livereload/livereload-js/issues/16
Partially contributed by Jeff Minard (@chuyskywalker).
Fixes#2205
This commit adds the interface ContentReWriter in the tranformer chain.
This is backed by two pooled byte buffers, alternating between being the reader or the writer.
This keeps the performance characteristic of the old implementation, but in a thread safe way.
Fixes#911
Benchmark old vs new:
benchmark old ns/op new ns/op delta
BenchmarkAbsURL 17614 17384 -1.31%
BenchmarkXMLAbsURL 9431 9248 -1.94%
benchmark old allocs new allocs delta
BenchmarkAbsURL 24 28 +16.67%
BenchmarkXMLAbsURL 12 14 +16.67%
benchmark old bytes new bytes delta
BenchmarkAbsURL 3295 3424 +3.92%
BenchmarkXMLAbsURL 1954 1987 +1.69%