Colin Westwater

Blog Migration Part 3 - Workflow

On this page

Introduction

I was using Blogger as my platform for hosting this blog. It was ok but things like adding code was a pain to format and get right. I never liked the templates that were available and the editor was pretty basic. I had heard about using GitHub for hosting your website and as I am keen to learn more about GitHub, it seemed like a good idea to see if I could migrate the blog to GitHub Pages. Turns out doing this I learn a lot of new things such as GitHub, Markdown, Jekyll, Visual Studio Code and a little Linux.

Workflow

In bash run the commands browse to your local repository directory and run Jekyll using the command jekyll serve –watch –force_polling –drafts. Note the –drafts option

Create the post using your favourite editor. I like Visual Studio Code as it has a Markdown extension which helps when writing. Make sure you put in your YAML front end code at the start of the post. Save the .md file in the _drafts folder

When you save the file, Jekyll will see the new file in the drafts folder and regenerate the site. Browse to http://127.0.0.1:400 to view the post on the site.

Once happy with the post move the file from _drafts to _posts

I stop and then start Jekyll again without the –drafts option. Make sure the post is shown

Commit the changes to the local repository using GitHub Desktop

Push the local copy to GitHub using GitHub desktop

Keep hitting F5 on the internet blog site until GutHub refreshes the site

It’s actually a simple process once you have done it a couple of times. VS Code has a Git Client built in which I will migrate too, but I want to get comfortable first with GitHub.

Google Analytics

One thing I missed from the Blogger platform was the basic stats about the site. Was anyone actually reading this content? It’s pretty easy to use Google Analytics to replace this, and it’s more powerful data. Sign up your domain URL in Analytics and get your Tracking ID. Open _config.yml and browse to the # Analytics section. Change the provider: to “google” and put your tracking_id: in.

Branching

Another benefit to using Github for the site is when making changes to the structure or configuration. Instead of potentially breaking your production master branch, simply create a Test branch. Make your changes there, make sure it works, then merge back into Master.

Conclusion

This has been a fun process for me. I learnt a lot and I feel my blog looks so much better now and is infinitely customisable. If you are thinking of starting a site or want to migrate, GitHub pages with Jekyll is definitely worth considering.