Static Sites Using Jekyll
I recently converted this site, enlightenedpixel.com, from WordPress to a Jekyll static site, and I’m very, very happy with the result.
Static sites are nerdy, and niche, and certainly aren’t the answer in many situations, but they have a number of wonderful benefits in situations where they are a good fit. My enlightenedpixel site is such a situation, perhaps the perfect situation, and I love the result of the conversion. Here’s why:
Jekyll Fits Perfectly with My Preferred Toolset
Now that the site is on Jekyll, I can use tools like Sass, Bourbon, Markdown, Bundler, Git, and my trusty Sublime editor to write content. As a Rails developer, these tools are home to me and I’m very productive using them. Using WordPress, or most other CMS’s, it’s not easy to use modern preprocesser tools like Sass, Bourbon, and Markdown.
The question of how, when, and what to backup or version just goes away. My whole site exists in Github. Every change is a commit, so I have full versioning and a natural backup of the entire site. In addition, with Bundler, I have a complete graph of all of the dependencies needed to generate the site, along with the specific version number of each dependency.
In WordPress there is always the question of when to run a backup. Should it be done on a schedule? How about before an upgrade of the WordPress software? What about after the upgrade? After a post is written or a page is changed? Do you backup plugins? How about WordPress files? Did you remember to get the uploads directory? These are certainly answerable questions, but they take time and thought to answer properly, and they all go away when you simply manage the entire site as a standard Github project.
Using my own editor to write content is enormously beneficial because not only do I have complete control over the markup, but I have tools like keyboard shortcuts and full project search at my disposal. For example, if I want to change the capitalization of something like ‘Wordpress’ -> ‘WordPress’ site-wide, how would I do that in WordPress? Do I need to perform a full text search and update in the database? Or even open each page and post and make the correction? With my editor, it’s a simple find and replace.
Clean Separation of Content, Layout, and Style
Posts and pages are in Markdown, a pure and clean style of content. Layout files are nearly pure HTML with a little bit of view logic. This feels good. It’s back to basics, clean separation of concerns.
I cringe when I have to get in and modify my own WordPress theme, let alone redesign the site. The markup is endlessly tangled with PHP and WordPress specific functions that require me to dig into documentation to alter in any way.
Faster Page Loads
Since this site is only simple, cacheable html files, it is fast. There are no database lookups, or pages to compile on the fly. I still have some work to do in terms of page speed, but the site is already faster.
I’ve worked on many WordPress sites over the years, and most have been hacked at one point or another. Certainly there are ways of securing WordPress, but it’s such a big target, and there are so many attack vectors. You have not only the framework, but the network of plugins, and potentially the issue of shared hosting. In the perfect world, all sites would be in a sandboxed environment like a Digital Ocean Droplet or other VPS, but the reality is that most WordPress sites are on shared hosting and are endlessly attacked with spam or malicious code.
Static sites usually exists on Amazon’s S3 or Github Pages. As long as the permissions are correct, there is very little to hack. Plus, I trust Github and S3 infinitely more than GoDaddy.
At the time of writing, Amazon S3 is $.03 per GB stored, plus $.004 per 10,000 requests. For a site the size of enlightenedpixel, that’s pennies per month. I wouldn’t convert an entire site just to save a few bucks a month, but it’s a nice side benefit that I can now host the site essentially for free.
In situations where a static site makes sense, it is a breath of fresh air, and a pleasure to work with.
I’ll blog more about when a static site makes sense in the future, along with what I’ve learned along the way, and the steps I took to convert this site from WordPress to Jekyll.
I’d encourage anyone with a simple content site or blog to take a look into Jekyll or one of the many other static site generators, it might just be the perfect fit for you too!