December 26, 2020

Holiday Break Housekeeping

Consolidating all my posts into a single site using Ghost + Github Pages for free!

Holiday Break Housekeeping

I’ve always liked writing about the work that I do and that all started back in 2012 with my first Blogger post. I remember working on my first Android app with my brother and I was trying to parse some JSON from the Google Finance API, which was proving to be tough. It’s been a long journey from that point but It’s nice to see how far I’ve come as an engineer. The places where I’ve shared my work has changed through the years as well. From Blogger I went to Google+(💔) and finally settled into Medium with some peppering of Tweets along the way.

With hopping from one platform to another I never realized how fragmented my content had become, with a holiday break from work, I set out to consolidate all of it into Github Pages hosted site using Ghost.

Ghost 👻

Ghost is an open source CMS for blogging. They have paid hosting but also the ability to run locally via Ghost CLI. Running locally, you could create & make all changes necessary and then export as a static site using buster. Buster takes that local website generated by Ghost (hosted at //wdziemia.github.io) and exports it to a directory. You can then take the contents of that directory and host it into a public repository which leverages Github Pages. You now have completely free CMS & hosting, all be it a somewhat manual process.

Jekyll is similar to Ghost, but includes the static export functionality, making it that much simpler to get up a running. From their Github Repo:

Jekyll is a simple, blog-aware, static site generator perfect for personal, project, or organization sites. Think of it like a file-based CMS, without all the complexity. Jekyll takes your content, renders Markdown and Liquid templates, and spits out a complete, static website ready to be served by Apache, Nginx or another web server. Jekyll is the engine behind GitHub Pages, which you can use to host sites right from your GitHub repositories.

Migrate

Migrating can be a bit of a pain, luckily there are some tools that can help you migrate from multiple other sites.

Medium 👉 Ghost 2.0: https://github.com/ageitgey/medium_to_ghost. This tool gets your posts mostly there. There is some cleanup needing to be done with some of code blobs and duplicate header images.

Blogger 👉 Ghost 1.0: https://github.com/jessehouwing/Blogger2Ghost. While I came across this tools, I ended up just exporting my posts and manually copy-pasting into new posts. I had already set up Ghost using v3.0 so downgrading/creating a new instance would’ve been more work than the few posts I had to convert.

Google+ 👉 Ghost: 💀 While this would be great, I haven’t found anything useful so I ended up just taking the most important posts and converting them manually.

Updating Ghost Versions: https://ghost.org/docs/update/

Customize

It’s simple to customize your site theme since the structure is all defined in multiple handlebar(hbs) files. You can read more about site themeing here along with some great docs explaining the content API. Starting off you’re defaulted to using the Casper:

TryGhost/Casper
The default theme for Ghost. Contribute to TryGhost/Casper development by creating an account on GitHub.

I went from Casper to then using Editorial. I loved the drawer which is what I was looking from the start.

TryGhost/Editorial
A free, open source theme for Ghost. Contribute to TryGhost/Editorial development by creating an account on GitHub.

I then started to get more comfortable with handlebars. I was able to come up with something (very rough) within a couple of days of work, having brushed off my novice CSS knowledge from High school.

Going Forward

My blog (w.dziemia.com) is still going to go through more iterations but its a start of consolidating all my content into a single source of truth (#solid). From there I can re-post that content to whatever platform is the new hotness at the moment. Most importantly, it keeps my content away from any subscriptions/paywalls!