I’ve been noticing a lot of chatter about static site generators over the last couple of months and they sounded like an intriguing topic so I decided to dive straight in and have a go for myself.
What is a Static Site Generator and Why Would You Want to Use One?
A static site generator is a tool that will allow you to create websites locally using some techniques which are normally done server side such as includes and templating. It will then take your files and compile them into pure HTML.
So why would you want to do that?
- Well for a start pure HTML is always going to be faster to load than any client side or server side HTML generator.
- Many static site generators can also generate blog templates for you in pure HTML which means no reliance on a database or CMS.
- Many also include handy local servers with live reload functionality so you can magically see the changes you make in your code appear in your browser.
- In addition to this when they generate your HTML code most of the generators have the option to compress your code automatically, usually minified CSS and JavaScript, and some of them will even automatically optimise your images!
- And if you were planning on making a static site to start with then the templating and other handy features will help you speed up the development process and keep your code DRY.
Which Static Site Generator Should I Choose?
There are currently a few options available for static site generation. I haven’t tried all of them but the idea behind them is generally the same.
Hammer for Mac
As you could probably guess from the name Hammer is an app for macs. It includes all the good stuff you’d expect from a static site generator; templating, CoffeeScript and SASS support (no Compass yet). And it’s all wrapped up in a nice interface. A good choice if you’re a mac user looking for a straightforward option.
Mixture
Mixture is currently in a private alpha but will be available for both mac and windows. Mixture is a GUI based tool similar to Hammer but includes a few more features that may make it the preferable option. It supports SASS and Compass as well as Less and Stylus if those are your CSS preprocessors of choice. Mixture will also optimise and compress your files for you. So far Mixture is the only option I have found with a GUI for Windows but if you want to download it now you’ll need to sign up for the preview and hope you get in.
Jekyll / Octopress
Now we’re getting into the scary world of Ruby gems (If you don’t know what those are then the following static site generators are probably not for you). Jekyll is mainly designed for text based sites such as blogs, first you set up what makes the structure of your site (pages, posts etc.) then you write your blog post in markdown or another supported language and Jekyll will spit out an HTML site with pagination and categories and all that good stuff you expect from a blog. Whenever you add a new blog post you simply write it locally, have Jekyll recompile your site and upload.
I have also included Octopress as an option here as it is a spin off of Jekyll that is already set up for a standard blog format, removing some of the learning curve of Jekyll.
Middleman
Middleman is certainly the most feature filled static site generator on this list (and my tool of choice). It is another Ruby gem based option:
Providing dozens of templating languages (Haml, Sass, Compass, Slim, CoffeeScript, and more). Makes minification, compression, cache busting, Yaml data (and more) an easy part of your development cycle.
For me the main attraction of Middleman is it’s versatility. It can compile any supported language into another one, an example of this would be that you can write pages in Markdown that compiles to ERB (Ruby Templating Language) which then compiled to HTML. And it’s not just HTML that Middleman can generate, it could be anything you want – you could use it to generate PHP code if you wanted (I’m not sure why you would want to but it’s nice to have the option). Middleman also has a blog extension to make it similar to Jekyll and many advanced compression tools.
And Many More
There are a whole load of other options out there (mainly Ruby gem based, but there are also a number of PHP based tools and many more), I have just included the ones that I have heard most about. There is a nice list of static site generators available here but is in no way comprehensive so do your own research and find one that you like and you won’t look back.
The Future
Static site generators seem to be picking up steam, and rightfully so. They now make a viable alternative to simple server side based sites and can even be an improvement on full fledged content management systems in the right scenario. And with new tools with nice GUIs coming out I’m sure there will be a whole lot more people interested in using them.
Have you tried any yet? If so which one and how did you find it?


James Agate
Roger Green
Want to chat about your project or requirements? If you call now you can talk to me directly:








Static sites are also more secure. There is much less to exploit in a static file + webserver setup compared to a more normal database + programming language + webserver site.
I’ve made a couple of static sites using Hakyll (http://jaspervdj.be/hakyll/) and found it easyish to work with.
As I’m writing this I’m thinking of one static site disadvantage: no comments without using something like Disqus
Good point Richard. Lots of WP blogs still use Disqus or some kind of comment/mention aggregator (we use MailChimp’s) so I don’t think that would be a negative for everyone but definitely a hassle to export historic ones from WP. In saying that it’s more likely to be dev’s using this setup I think so they probably wouldn’t bother to much about that hurdle. Thanks for stopping by and adding your feedback
I’ve used Bricolage CMS which can output an HTML site from the content, and it was completely secure for the reasons Richard mentioned. I would prefer all my CMS systems to do this, actually.
However, trying to train non-techie staff on any aspect of it was the ultimately defeating point of the system … some balance with static site generator “hand-shaking” with a familiar social media interface (i.e. wordpress) would be more of a complete CMS organizational solution that just a developer based one.