I did say more coming soon, right… So here’s another.
This time it’s the SnS Minifier Extension found at:
Again, early release (v0.1) so please give me feedback.
From the README file:
= Styles 'n Scripts Minifier
Adds the ability to minify CSS and JS files. This way, you can keep your
the way you like it in the editor but serve up minified files. (And if
really want to speed things up, add GZip to the mix to have your server
== Available Minifiers
- JSMin v1.0.0 - This is based on the original C code by Douglas
(JSMin) but wonderfully
into a plugin by Ryan Grove
(GitHub - rgrove/cssmin: 💀 Ruby library for minifying CSS. Unmaintained.).
JSMin is often seen as being an older but safer technology. It certainly
doesn’t pack as well as some others out there but is tried and true.
- CSSMin v1.0.0 - This is Ryan Grove’s port of the YUI Compressor’s
(http://www.julienlecomte.net/yuicompressor/) CSS minifier (which was
taken from Isaac Schlueter’s regular expression based CSS minifier
(Isaac Z. Schlueter)
Ryan nicely ported this one to a plugin too. And I added a minor
too (which is available via options – see below)
- Packr - James C. was nice enough to port Dean Edward’s famous
(/packer/). More about the plugin version used
can be found at: (http://blog.jcoglan.com/packr/)
Packer is a great tool but it is pretty strict about terminating
with semicolons (/packer/usage/sample.html).
- Rainpress - This is a newer ruby project by Uwe L. Korn to minify CSS
(Google Code Archive - Long-term storage for Google Code Project Hosting.). There isn’t much history but it
seems solid enough.
I had to repackage this one into a plugin (and strip a lot of the
line stuff out). Originally I did all this as I didn’t know about
Anyway, I included this too basically because I’d already done
It’s pretty simple, really. Once installed, it adds a “Minify?” checkbox
file. Viola, the content is minified.
The configuration can be changed via the @@settings variable inside:
There, you can choose which minifiers you want to use and set any of
- Radiant v0.6.7 or higher
- Styles 'n Scripts Extension v0.5 or higher
Install the extension in your Radiant project like:
You will need the Styles 'n Scripts extension installed for this to work
will also probably need to change your project’s environment.rb file to
the load order (the SnS Extension must be loaded before this one). For
you could use something like:
config.extensions = [ :all, :sns_minifier ]
== To Do
Well first of all this extension needs some specs.
But after that I’d love to find where someone ported the YUI
version) to ruby. It appears to be much more flexible (read forgiving)
Packer while still crunching stuff way down. A second option would be to
admins install the java version and make this plugin interact with that.