Growing with the Web

Migrating a blog from Jekyll to Ghost

Published
Tags:

I recently migrated beautemia.com from Jekyll on GitHub Pages to the Ghost blogging platform. Here’s how I did it and what I thought of Ghost.

Hosting

One of the major things about Ghost is that hosting will likely cost some money. I ended up going with DigitalOcean which seemed like the cheapest and has a Ghost image set up to make set up even easier. The cheapest tier is $5/month for 512MB memory, 1 processor, 20GB SSD and 1TB transfer which should be sufficient given the current traffic of the site.

Just creating the image (or droplet as DigitalOcean calls it) will give you a working instance of Ghost at the server’s IP address (the admin console at /ghost). Assigning a domain to the instance, installing a theme or setting up URL redirection requires connecting via SSH and configuring appropriately. Set up would definitely have been much more of a challenge if I didn’t have any experience with Linux.

Installing themes

Theme installation is simply a matter of dropping the theme into <ghost-instance>/content/themes/, which on a DigitalOcean instance is located at /var/www/ghost/content/theme/. My theme is just a clone of the theme’s git repository so I can update when required with a git pull.

Redirecting URLs

When Beautemia moved from Blogger to Jekyll 6 months ago, I decided to retain the URL structure of <domain>/<year>/<month>/<post-title>.html. In order to retain page rank, the pages should either be at the same location or redirect to the new location. While the first is possible by modifying the Ghost database, I decided to opt for the latter which can be done by adding a few rules to Nginx.

I set up a 301 redirect for every post which involved adding rules like this in /etc/nginx/sites-available/ghost:

location = /2015/11/summary-blizzcon-2015.html/ { return 301 /summary-blizzcon-2015/; }

Setting the domain name

As described in this tutorial, setting a domain name on a DigitalOcean instance of Ghost is a matter of adding the domain to /etc/nginx/sites-available/ghost and /var/www/ghost/config.js. Don’t forget to restart the server after doing this using sudo shutdown -r 0 for the changes to take effect.

Writing experience

Like it or not, the content writing experience definitely requires more technical knowledge in Jekyll. This was the main driving force behind changing the underlying platform.

Editor

The Ghost editor is nice as it provides a live preview of the rendered markdown. My only critisism is that it might be difficult for people unfamiliar with markdown initially due to formatting buttons being absent from the UI.

Images

Images in particular were quite troublesome in Jekyll, the elaborate system I set up for image optimisation and flexibility of display certainly didn’t help the issue. The Jekyll-based system required the following:

  1. Put the image into __images/
  2. Run grunt to optimise images into images/
  3. Add the image in the post using a Jekyll include, using a different include depending on how the image is to be displayed. For example:

This has thankfully been reduced with Ghost to:

  1. Add ![] to the post to indicate an image
  2. Drag the image to the post preview, this will upload and add the URL in markdown

Post metadata editor

Ghost comes with a nice post settings dialog so there is no need to deal with YAML.

Themes

The theme I used is forked from Saga. Based on my brief experience dealing with themes, my impression is that they’re simple yet powerful. The page templates use handlebars which is quite elegant and concise compared to the alternative with Jekyll while still providing the same utility. Plus, since Ghost is actually a dynamic server, it’s possible to add some logic to the template.

What should you use?

So the ultimate question; after running a blog for 4 years, jumping from platform to platform, what do I recommend as a blogging platform?

Ghost

Ghost is probably the best blogging platform out there. Coupled with Ghost Pro it’s fairly easy to get an instance up and running as well.

Pros

Cons

  • Ghost is not designed for building a site that is a more than a series of dated posts
  • Server set up can take a little time depending on your hosting, this could be a pro if you want to learn like me though
  • Running the server will likely have a recurring cost

Jekyll on GitHub Pages

Jekyll allows you to do pretty much anything you want fairly nicely as long as it’s static content. There are tricks you can use to simulate it being dynamic (Math.random) but this will probably either push the weight of the page out or rely on the browser’s cache which could be cleared at any time.

While I am somewhat jealous of some of the niceties of Ghost, Growing with the Web is sticking with Jekyll as I’ve built this site out to be a little more than just a blog which is what Ghost is designed to do really well.

Pros

  • It’s open source
  • Free on GitHub Pages
  • Incredibly flexible
  • All content is just in a Git repository, making it very easy to find and edit content across multiple files
  • Static sites are super fast as there is no special server processing required to generate the page

Cons

  • No dynamic content, a URL will always return the same page
  • No SSL support for custom domains (yet?)
  • No plugins on GitHub Pages for security reasons

Blogger

Blogger or other similar platforms are good for people who aren’t that great with computers. They’re designed to be set up with next to no technical knowledge and to start writing as soon as possible.

Pros

  • Super simple to set up
  • Free
  • SSL support

Cons

  • Difficult to modify look and feel outside of using the existing templates
  • Restricted access to post data, making it difficult to modify multiple posts quickly
  • The HTML the WYSIWYG editor generates is a mess
  • You can do very little with the templates
  • Google has barely touched it for 10 years outside of adding Google+ comment integration

Like this article?
Subscribe for more!