Slim for static sites

I’m a big fan of preprocessing. I prefer Slim, Sass, and CoffeeScript to plain HTML, CSS, and Javascript. They are cleaner to read and easier to type. They are also very easy to use in Rails. But what about using them for static sites, without Rails?

Although Sass and CoffeeScript have command line compilers, I couldn’t find anything as easy to use for Slim.

In the end, I realized that the right way to go is using Middleman, a Ruby framework for building static sites and blogs. It uses the same sort of asset pipeline as Rails does, so all of the compiling and preprocessing is done for you. It’s livereload feature is a big win for productivity as well.  In short, it sets everything up exactly as you need it for a killer static site workflow that includes html and asset precompilation, without you having to worry about the detailed configuration.

So, how can you compile Slim on the command line to use in a static site?  My answer would be: don’t — save yourself some trouble and use Middleman instead!


Published by


Software Engineer

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s