Lion statue

Static Site Generator Shootout – JBake vs Jekyll

Earlier this year, I’ve been experimenting with static site generators. My eventual goal is to move this blog and a few more into static sites. After some experimentation, my conclusions are pretty predictable.

Ask any one what software to use if you want to run a blog. Most people will suggest WordPress right away.

For the longest time, I’ve also done so. It has a huge community with a plugin for everything you can think of. I run four sites on WordPress. Some popular, some not so much.

Last year I started to change my mind about WordPress as the default choice. If any of my sites gets the least bit of traffic, my host will start to complain because of excessive resource usage. Shared hosts are notoriously aggressive in shutting down sites that demand too many of their servers, but they have a point.

Explosion
Small impression of my shared host’s server whenever I publish something popular.

WordPress is not designed to serve a lot of traffic. Out-of-the-box, WordPress is a fully dynamic site and requires a lot of tweaking to perform acceptable.

On top of that, WordPress is a prime target for all kinds of attacks by script kiddies who just want to have fun. Not only do you need to update ASAP if a security patch comes out, but there are numerous ways some one can launch a successful denial-of-service attack on your site.

There is a much simpler solution: don’t use any dynamic code that requires server resources. Create all your HTML pages offline and don’t run any code to serve them to your customers.

Enter: static site generators.

A static site generator takes a general site layout and plain text content and merges everything into a nice package of static JavaScript, CSS and HTML pages. No need to have anything running on the server, except for the bare minimal highly optimized web server.

I’ve taken a look at two static site generators:

  • Jekyll. It’s the one every one is using.
  • JBake. It wants to be Jekyll, but written in Java.

5 reasons to use JBake

Forest View Bakery
Bake your site with JBake

I’ve used JBake to create and host a small personal site. The site has been running for half a year without issue. It responds about a 100 times quicker then any of my WordPress sites. It hasn’t received too many content updates, because I haven’t configured a good automated deployment process.

It was easy to get started, but it does require a bit of work to get everything going.

Most importantly, there are no themes available, so you’re on your own. At least, you were, here’s one that I made and that you can use.

Reasons why I’d use JBake again:

  1. It’s written in Java. If Java is your primary programming language, this is going to be the main reason for using JBake
  2. It doesn’t have any bells and whistles, but it does everything you need.
  3. The code is minimal and readable, so you can extend it easily.
  4. If you like the underdog, JBake is perfect.
  5. Euhm… Did I already say it’s written in Java?

5 reasons to use Jekyll

Jekyll logoI haven’t deployed any sites with Jekyll yet, but I’m working on converting this site.

Reasons why I’m using it:

  1. Every one uses it. The documentation is clear, but even if you have an issue, you can just Google it.
  2. There are a lot of premade themes available.
  3. If you want extra functionality, there’s probably already a plugin for that.
  4. You can host it on GitHub for free (with some limitations)
  5. There are many ways to easily deploy your site to various other hosting options.
  6. Ok, one more: You can automatically convert existing WordPress sites.

Conclusion

I see no reason why you would make your life difficult. Just go with Jekyll. Unless you really, really want to know the ins and outs of a site generator and you only know Java and don’t want to learn the slightest bit of Ruby.