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.
<figcaption class="wp-caption-text">Small impression of my shared host’s server whenever I publish something popular.</figcaption></figure>
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:
5 reasons to use JBake
<figcaption class="wp-caption-text">Bake your site with JBake</figcaption></figure>
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:
- It’s written in Java. If Java is your primary programming language, this is going to be the main reason for using JBake
- It doesn’t have any bells and whistles, but it does everything you need.
- The code is minimal and readable, so you can extend it easily.
- If you like the underdog, JBake is perfect.
- Euhm… Did I already say it’s written in Java?
5 reasons to use Jekyll
I haven’t deployed any sites with Jekyll yet, but I’m working on converting this site.
Reasons why I’m using it:
- Every one uses it. The documentation is clear, but even if you have an issue, you can just Google it.
- There are a lot of premade themes available.
- If you want extra functionality, there’s probably already a plugin for that.
- You can host it on GitHub for free (with some limitations)
- There are many ways to easily deploy your site to various other hosting options.
- 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.