Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-05-27deps: Update to github.com/tdewolff/minify/v2 v2.11.5Bjørn Erik Pedersen
2022-04-08deps: Update github.com/tdewolff/minify/v2 v2.10.0 => v2.11.0Joe Mooring
Fixes #9713 Fixes #9740 Adds support for minify.tdewolff.svg.keepComments (bool)
2022-04-08Rework the Destination filesystem to make --renderStaticToDisk workBjørn Erik Pedersen
See #9626
2022-03-18all: gofmt -w -r 'interface{} -> any' .Bjørn Erik Pedersen
Updates #9687
2022-03-09minifiers: Make keepWhitespace = false default for HTML (note)Joe Mooring
Closes #9456
2021-09-22Pass minification errors to the userPaul Gottschling
Previously, *minifyTransformation.Transform suppressed the error returned by t.m.Minify. This meant that when minification returned an error, the error would not reach the user. Instead, minification would silently fail. For example, if a JavaScript file included a call to the Date constructor with: new Date(2020, 04, 02) The package that the minification library uses to parse JS files, github.com/tdewolff/parse would return an error, since "04" would be parsed as a legacy octal. However, the JS file would remain un-minified with no error. Fixing this is not as simple as replacing "_" with an "err" in *minifyTransformation.Transform, however (though this is necessary). If we only returned this error from Transform, then hugolib.TestResourceMinifyDisabled would fail. Instead of being a no-op, as TestResourceMinifyDisabled expects, using the "minify" template function with a "disableXML=true" config setting instead returns the error, "minifier does not exist for mimetype." The "minifier does not exist" error is returned because of the way minifiers.New works. If the user's config disables minification for a particular MIME type, minifiers.New does not add it to the resulting Client's *minify.M. However, this also means that when the "minify" template function is executed, a *resourceAdapter's transformations still add a minification. When it comes time to call the minify.Minifier for a specific MIME type via *M.MinifyMimetype, the github.com/tdewolff/minify library throws the "does not exist" error for the missing MIME type. The solution was to change minifiers.New so, instead of skipping a minifier for each disabled MIME type, it adds a NoOpMinifier, which simply copies the source to the destination without minification. This means that when the "minify" template function is used for a particular resource, and that resource's MIME type has minification disabled, minification is genuinely skipped, and does not result in an error. In order to add this, I've fixed a possibly unwanted interaction between minifiers.TestConfigureMinify and hugolib.TestResourceMinifyDisabled. The latter disables minification and expects minification to be a no-op. The former disables minification and expects it to result in an error. The only reason hugolib.TestResourceMinifyDisabled passes in the original code is that the "does not exist" error is suppressed. However, we shouldn't suppress minification errors, since they can leave users perplexed. I've changed the test assertion in minifiers.TestConfigureMinify to expect no errors and a no-op if minification is disabled for a particular MIME type. Fixes #8954
2021-07-20minifiers: Make keepWhitespace = true default for HTMLBjørn Erik Pedersen
Fixes #8771
2021-06-18media: support application/manifest+jsonRohan Kumar
The standard file extension for Web App Manifest files is ".webmanifest". This commit allows Hugo to recognize .webmanifest files as "application/manifest+json" files and to minify them using its JSON minifier. The .webmanifest file extension is recommended in the w3c spec to simplify media type registration: https://www.w3.org/TR/appmanifest/#media-type-registration Webhint docs are also relevant: https://webhint.io/docs/user-guide/hints/hint-manifest-file-extension/ Closes #8624
2021-06-14Misc config loading fixesBjørn Erik Pedersen
The main motivation behind this is simplicity and correctnes, but the new small config library is also faster: ``` BenchmarkDefaultConfigProvider/Viper-16 252418 4546 ns/op 2720 B/op 30 allocs/op BenchmarkDefaultConfigProvider/Custom-16 450756 2651 ns/op 1008 B/op 6 allocs/op ``` Fixes #8633 Fixes #8618 Fixes #8630 Updates #8591 Closes #6680 Closes #5192
2021-03-20deps: Bump github.com/tdewolff/minify/v2 v2.9.15Bjørn Erik Pedersen
Fixes #8332
2021-02-18deps: Update github.com/tdewolff/minify/v2 v2.6.2 => v2.9.13Bjørn Erik Pedersen
Fixes #8258
2020-12-16all: Fix minor typosPhil Davis
2020-12-03all: Format code with gofumptBjørn Erik Pedersen
See https://github.com/mvdan/gofumpt
2020-10-07Revert "deps: Update to github.com/tdewolff/minify v2.9.4"Bjørn Erik Pedersen
Closes #7792 This reverts commit b254532b52785954c98a473a635b9cea016d8565.
2020-09-19deps: Update to github.com/tdewolff/minify v2.9.4Bjørn Erik Pedersen
2020-03-20Some minify configuration adjustmentsBjørn Erik Pedersen
2020-03-20Add minify configSatowTakeshi
Fixes #6750 Updates #6892
2020-01-23Revert to minify v2.6.1Bjørn Erik Pedersen
Closes #6791
2020-01-07minifiers: Update to new CSS configBjørn Erik Pedersen
Update #6719
2019-11-03minifiers: Add a JSON roundtrip testBjørn Erik Pedersen
See #6472
2019-08-12tests: Convert from testify to quicktestBjørn Erik Pedersen
2019-03-24all: Apply staticcheck recommendationsBjørn Erik Pedersen
2018-12-07minifiers: Fixx CSS2 color code handlingBjørn Erik Pedersen
Fixes #5506
2018-11-07deps: Update minifyBjørn Erik Pedersen
No functional changes, just support for Go Modules.
2018-09-13minifiers: Set minifier to KeepEndTagsAlexandros
See: https://github.com/tdewolff/minify/blob/948b6490cf3cacab5f4d7474104c3d21bf6eda46/README.md#L171
2018-09-12minifiers: Make JSON minification more genericJames Kiefer
Add a regex matcher for json types. Specifically support LD+JSON which allows for google seo minification out of the box. Expanded JS/JSON minification testing.
2018-08-28Improve minifier MIME type resolutionBjørn Erik Pedersen
This commit also removes the deprecated `Suffix` from MediaType. Now use `Suffixes` and put the MIME type suffix in the type, e.g. `application/svg+xml`. Fixes #5093
2018-08-25minfiers: Keep end tagsvsopvsop
Fixes #5112
2018-08-18minifiers: Do not strip IE conditional statementsBjørn Erik Pedersen
Fixes #5089
2018-08-14minifiers: Make the JS minifier matcher less specificBjørn Erik Pedersen
Fixes #5073
2018-08-06Add support for minification of final outputBjørn Erik Pedersen
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