March 20, 2016

Generating static websites with Clojure

I'm a big fan of working with static sites whenever I can.

Some of the reasons for my affinity for static sites:

  • They're fast (No need to compile on the server)
  • They're secure (No WordPress/Drupal malware to worry about)
  • They can be hosted just about anywhere (often for free!)
  • Deploying them is as simple as copying a directory somewhere (easy to script/test)
  • They're simple to hack/tweak to your hearts content
  • I can write my content in MarkDown (Less error prone than most WYSIWIG editors and much easier to work with then HTML)

Netlify has a great write-up about the benefits of static sites: Why Static?

Static site generators

There are a ton of static site generators out there, available in pretty much any language you are interested in. Some of the most popular static site generators are:

Full list of generators

Cryogen

I'm on a bit of a Clojure kick right now. So when I started thinking about getting this site up and running again I looked around for a site generator written in Clojure. That's when I stumbled on Cryogen which fit the bill perfectly. It's written in Clojure, has most of the functionality I want and has a decently active community on GitHub.

There are a few rough edges that I've noticed but that's the great thing about open-source projects like this, if the project is missing features I want, I can add them myself.

Links

If you're interested in learning Clojure there are a ton of great resources online. I've really enjoyed:

If you're interested in Cryogen head over to the project's GitHub or website and look around!

Tags: Open-Source MarkDown Cryogen Clojure GitHub