Takeaways of my Explorations

Jekyll Template setup for GitHub Pages

This website of my technical explorations is hosted by GitHub Pages which uses Jekyll to generate the static site using Markdown content. Initially, I had used one of the default themes supported by GitHub pages. But soon, I got bored of it and wanted to try something different.

So I started looking for better Jekyll templates (other than the ones supported by GitHub Pages) for my posts and started setting up everything. After successfully having updated the template, I thought why not make a post about this adventure!

I have two purposes for writing this post. First, this might be helpful for anybody who is looking to use a different theme than the default ones and second, a few years down the line when I decide to upgrade/move to some better templates I might need to follow the same procedure again.

Pre-requisites

This post assumes you already have GitHub Pages enabled repository or at the least, you know how to create one. If not, please visit here to know about it.

Content

  1. Install Ruby and Jekyll
  2. Setup a quick-start template
  3. Configure and add the content
  4. Drink a cup of coffee!

Install Ruby and Jekyll

You can skip this step if you already have Ruby and Jekyll installed! I started from scratch, so I had to install Ruby, Jekyll and Bundle. I blindely followed these installation steps described for Ubuntu 16.04.

To verify if Jekyll is successfully installed and is of latest version, run this:

bundle exec jekyll --version

Which should give you (at the time of writing this post)

jekyll 3.1.6

Yaay! I know have Jekyll installed!

Setup a Quick-start template

First thing I did when I wanted to change the theme of my GitHub pages site was, look for other GitHub pages based sites and see what themes are being used. After spending hour or so, I ended up at this site called Skinny Bones and I liked the simplicity of it.

I started following these steps describing how to use this quick-start template and customise it for myself.

After downloading the template and running below commands, I had a static site up and running at http://localhost:4000

bundle exec jekyll build
bundle exec jekyll serve

Few keypoints here:

As of now, there was no content under _posts directory. Let’s see how to add some posts and customize the theme.

##Configure and add the content

Let’s look at basic set of things to configure in the selected template.

This is enough to make it look like this is your own site. I’ll update once I explore further.

Now let’s add some content to your site.

Create some markdown data and name file something like 2018-05-21-test-data.md and put this file under _posts directory.

Then rebuild and serve your site by

bundle exec jekyll build
bundle exec jekyll serve

Now visit http://localhost:4000 and there should be a post listed with a sample text from the 2018-05-21-test-data.md file under the date 2018-05-21.

Finally, add all these content (the _site directory can be ignored) into your GitHub Pages repository and your site with an awesome template should be up and running.

Now you can go and have a cup of coffee!