Production Ready Staticmatic Projects With Jammit and YUI Compressor or Closure
Switch to Bundler
Using bundler with staticmatic is pretty easy. Create your
Gemfile in the root path of your project:
hallosource'http://rubygems.org'gem'staticmatic','~> 0.11.0.alpha.8'gem'jammit','~> 0.5.3'
Run at the same place:
Activate bundler at the beginning of your
config/site.rb and activate Jammit:
config/site.rb, line 1 and lines 7 and following in
The second line determines if staticmatic currently builds or previews—it should compress the assets only in build mode. The YAML file is parsed with ERB by default.
Add a new helper (will be included by default) in
src/helpers/jammit_helper.rb (woohoo it’s so HTML5—without
You could also use
If you don’t have a Compass configuration, add the following line at the end of your
config/compass.rb add or change:
hallooutput_style = ARGV =='build'? :compressed : :expanded
Comments will appear on your localhost, but on your production server, it will use the compressed version (after you run
staticmatic build .).
It’s easy to build super-fast static websites with Staticmatic (as this blog itself), but Staticmatic doesn’t help you with with your assets. There’s no problem to add them by yourself, but this should be integrated by default.