Skip to content

Conversation

@salim-b
Copy link
Contributor

@salim-b salim-b commented Oct 16, 2019

The minification relies on the binary minify which is cross-platform and works on Windows, macOS, Linux and BSD. It is based on the same Golang library the static site generator Hugo uses for minification.

Pre-built minify binaries can be downloaded from here.
Alternatively, instructions to build minify from source are available here.

The test message created by prepare_test_message() was shrunk by about 33 % (from 10.3 to 7.7 KiB) by minification.

If desired, we could also apply minify() directly in compose_email(). Currently it's designed to be used in a pipeline like this:

library(blastula)

prepare_test_message() %>%
  minify() %>%
  smtp_send()

Addendum: I took the liberty of adding myself as a package author contributor in this PR.

The [minification](https://en.wikipedia.org/wiki/Minification_(programming))
relies on the binary [**minify**](https://github.com/tdewolff/minify/tree/master/cmd/minify)
which is cross-platform and works on Windows, macOS, Linux and BSD. It is based on the same
Golang library [the static site generator Hugo uses for minification](gohugoio/hugo#1251).

Pre-built minify binaries can be downloaded from [here](https://github.com/tdewolff/minify/releases).
Alternatively, instructions to build minify from source are available [here](https://github.com/tdewolff/minify/tree/master/cmd/minify#installation).

The test message created by `prepare_test_message()` was shrunk from 12.4 KiB to 9.1 KiB by minification (message sent as inline attachment).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant