Starting with Jekyll
I wanted to start a blog. I wanted to set it up for free, use a custom URL (and not something.bloggingplatform.com), and be able to both blog and create tutorials. I didn’t mind it possibly being technical1. Enter Jekyll.
If you want to get your blog in 10 minutes, skip to below.
Why Blog with Jekyll?
Here’s why you can and should blog with Jekyll (if you’re a data scientist):
- Jekyll has beautiful, free, open-source templates.
- GitHub will host your website for free2.
- Jekyll is static.
- Jekyll can be simple to set up3.
- I tried Wordpress and blogger.com and got frustrated.
- The blogging content you create is very portable (easy to take your posts from one blog site to another).
- Creating blogs in Markdown syntax is a dream (even for non-technical folks).
- You can manage your blog from your terminal
- You can manage your blog from your phone (if you have a GitHub-editing app)
But if you don’t like debugging occasional errors, you probably shouldn’t blog with Jekyll.
What is Jekyll, you ask? Jekyll is an open-source blogging platform. Anyone can write a template and post it, and anyone else can use that template. Perusing Jekyllthemes.org, you can pick out any template you’d like.
How did I get started with Jekyll?
As a blogging noob, I’ve discovered there are hundreds of ways to generate a blog (e.g., WordPress, Squarespace, blogger.com, Weebly, etc.). But when my colleague Arthur Lui showed me his blog, I wanted something similar. I first tried Wordpress, then tried blogspot, then gave up and followed Arthur’s example and landed with Jekyll.
Set up a blog in 10 minutes!
I followed this Jekyll tutorial to set up my first blog. I’ll simplify those steps here to get you up and running quickly:
- Get a GitHub account. (2 min)
- Go to Jekyllthemes.org. All of these blog themes are free. Find one you like, and Fork the repo (i.e., “repository”). (2-60 min, depending on how long you peruse)
- In GitHub, rename the newly-forked repo from “REPO name” to “yourgithubusername.github.io”. (1 min)
- Now go to “githubuserbame.github.io”. Voila, you have a blog.
And if you want to start writing posts, go to your “_posts” folder. Then create new files and follow the default templates that the repository provides. (The blogs will need to be written in Markdown syntax.)
That was my 10 minute promise. If you feel a bit cheated or lost, go to the well-done tutorial and do all the steps. But the steps I listed are the essential steps to setting up a blog from scratch. So if you want to make a few blogs really quickly, after you figure out the first one the others follow nicely. For example, once I finished the tutorial, I followed those steps above to try two other themes before deciding on the Centrarium theme.
To get Centrarium to work, I did have to change some configurations in the “_config.yml”, so there can be some minor debugging depending on the theme you choose. But with a little patience and some Googling, you’ll get it.
Add to Jekyll a custom URL from GoDaddy
You’ll notice I have a custom URL and not “bryanwhiting.github.io”. I used GoDaddy to get a domain. (I have no affiliation with GoDaddy.) Here’s how I linked GoDaddy with my GitHub Jekyll blog:
- Go to GoDaddy. Get a domain.
- In your Github repo, change (or create) a CNAME file in the main directory. (See my CNAME file for an example). And for the CNAME file contents, just type in the new “www” that you registered through GoDaddy.
- Then, on GoDaddy, go to the section “DNS Management”. Here’s where you tell GoDaddy how to connect your newly purchased “www” with GitHub. Create the following connections:
- [Type, Name, Value, TTL] = [A, @, 184.108.40.206, 600 seconds]
- [Type, Name, Value, TTL] = [A, @, 220.127.116.11, 600 seconds]
- [Type, Name, Value, TTL] = [CNAME, ftp, yourgithubusername.github.io, 600 seconds]
- [Type, Name, Value, TTL] = [CNAME, www, yourgithubusername.github.io, 600 seconds]
If you have the CNAME file in your GitHub folder, GitHub and GoDaddy will talk and after a few minutes your custom “www” will work. You don’t technically need the two [A] steps, but those connections allow users to type “bryanwhiting.com” instead of “www.bryanwhiting.com”. It can take up to 24 hours before these [A] connections enable, so don’t be worried if the short URL doesn’t work first try. But the full URL should work soon enough.
- Specifically, I was interested in being able to use the command line for my posts. Additionally, I didn’t mind seeing or using a little bit of code. [return]
- Someone has to host it (i.e., store and display all the files). I started off trying to set up a WordPress blog, but you have to pay another company to host. I didn’t want to bother. [return]
- If you try to set it up by following the instructions on jekyllrb.com, that’s the complicated way. That’s how I originally started, got lost for five hours, and stopped. Six months later, I found a better way. [return]