Migrating from WordPress to Jekyll

Why

After years of running my own WordPress instance on a VPS I decided to call it quits. Maintaining a server just for running a simple blog kind of got tiring. I spend enough time worrying about backups, security, availability, etc in my day job. Not to mention I was paying more than I pay for my monthly Netflix subscription to keep a resource hog like WordPress humming along.

Although I still liked the hackability of WordPress, so moving to something like Medium or hosted WordPress didn’t seem too appealing.

Search

After a bit of Googling, I decided to go with a static site generator. I liked the idea of being able to host the site virtually for free while retaining full control over the look and feel.

There are many static site generators out there but given Jekyll’s community and my familiarity with the Ruby ecosystem, it was an easy choice. Jekyll would allow me to tinker with the platform without worrying about tedious maintenance.

Now that I had settled on a new home for this blog, I had my work cut out for me. Here’s how I went about the migration:

Data Export

So the first task was figuring out how to get the existing posts out of WordPress. There are couple of options:

I went with the latter option since it saved me the trouble of installing Ruby on my VPS or opening up my DB to accept external connections.

Look & Feel

Now that I had the basics figured out, I started looking for a nice theme that I could use as a jumping off point. I browsed Jekyll Themes to find Hyde, a carefully crafted theme built by Mark Otto.

“Installing” the theme was pretty straight forward, I just forked the repo and dropped the contents of my _posts folder in there.

Customizations

After getting the theme up and running. I went about making a few modifications of my own:

Hosting

Now the last step was figuring out where to host this site. Official Jekyll website has pretty much documented all the deployment options out there. Simplest one out of them was to use GitHub Pages which comes with built in support for Jekyll and it’s free!

All you have to do is create a repository named username.github.io, where username is your GitHub username. Once you commit your project, it will automatically be deployed to http://username.github.io URL.

You could also have your custom domain point to that location. Just have to create an A record pointing to GitHub Page’s IP in the DNS settings and add a CNAME file at the root of your project with your domain listed in it. You can find detailed instructions here.

That was super easy to setup and only took a couple of minutes. Although one thing to keep in mind, GitHub Pages use Jekyll 2.x. So if you are working on Jekyll locally, you’ll want to add github-pages to your Gemfile so the local version of Jekyll and its dependencies are in sync with what GitHub Pages uses to avoid any inconsistencies based on environment.

Moving Forward

One thing I missed was having a nice WordPress editor where I could work on draft post as and when I please.

Luckily I was able to setup a very similar workflow using prose.io which is an excellent content editor for GitHub specifically designed for static websites like this. It has many configuration options allowing you to setup live previews, image uploading, etc. Definitely worth checking it out.

Lastly I’ve leave you with this screenshot of one of the metrics from my Google Webmaster Tools account.

GWTPerformance.png

That huge drop in page download time is, as you’d guess, right after I made the switch to Jekyll. I’m hoping that will eventually also translate into a bump in the search rankings as I’ve read Google now considers speed as one of the small factors in determining the results.

Anyway, that’s it for now. Stay tuned with more updates on my adventures with Jekyll and it’s ecosystem.

If you liked this post, 🗞 subscribe to my newsletter and follow me on 𝕏!