When I was trying to build this blog, I would search blogs and stumble upon a good one and my first thought would be “I wish the author did a post on how he put this site together”. It seems natural for me to do the first post on that very topic.

Short story ☞ From your GitHub account (say github.com/myGitAcc), Fork the Jekyll-Minima github repo and rename the repo as the myGitAcc.github.io to create your GitHub Page. ☞ Clone the repo to a Linux workstation. ☞ Add the custom code suggested by miller-blog to support tags. ☞ Add/Edit content in the workstation, rebuild the code, and push changes to GitHub.

Long story ☞ From your GitHub account, Fork the Jekyll-Minima repo and rename it as myGitAcc.github.io. For example, if your account name is myblog then, rename the repo as myblog.github.io and the page will be automatically hosted at https://myblog.github.io as your GitHub Page.

Prepare your Linux Workstation for building Jekyll sites. Following is for Ubuntu 22.04:

☞ Install required packages:

  sudo apt-get install ruby-full build-essential zlib1g-dev

☞ Add the environment variables in .bashrc and source it

  export GEM_HOME=$HOME/gems
  export PATH=$HOME/gems/bin:$PATH

Install jekyll and the bundler using gem:

  gem install jekyll bundler

Clone the GitHub repo using SSH URL (you need to be setup with SSH keys before doing that):

  git clone git@github.com:myblog/myblog.github.io.git

After the cloning is complete, the entire repo will be in a directory called myblog.github.io. Site-wise Jekyll configuration are done in _config.yml eg. title, author, email, description.. Check this doc for config option. For one time only, after the clone, get all the dependencies:

  bundle install
  bundle update 

Now you can make any changes to the site and build it

  bundle exec jekyll build 

This will build the static site from the markdown contents and ready to be hosted. Now you can commit and push the repo using git

   git commit --all [--allow-empty] -m "comment"
   git push

Blog posts are written in markdown and placed in the _posts directory. The header of this post looks like this

---
layout: post
title:  "How was this site build ?"
date:   2023-10-08 19:12:34 +0530
---
Content... 

Tags are an important component of blogs to search and organize data. Unfortunately, Jekyll’s minima template does not support tags by default. Followed this blog by Jason Miller to introduce some custom code to support tags. Summary of the blog: ☞ Include the keyword tags followed by the tags in the Front Matter of the posts. ☞ Created the Liquid command file _includes/collecttags.html which makes the list site.tags. ☞ Added a liquid snippet in _include/head.html to include collecttags.html. ☞ Added the html/liquid snippet in _layouts/post.html to display the tags in the post. ☞ Created _layouts/tagpage.html to display each tag in a separate page. ☞ Finally, a Python script tag_generator.py to create the tags. NOTE If python3 is not default in your installation, change the first line in the code to explicitly run python3 ie. #!/usr/bin/env python3. ☞ The only change I had to do is uncomment header-pages: in _config.yml to specifically display the pages in the header menu provided by the list under the header-pages: command. The tag generator creates a separate markdown file for each tag in the directory tag. Jekyll takes all these files and puts them in the header menu.

You can check this repo to checkout the codes to create this blog. Check out the Jekyll docs for more info on how to get the most out of Jekyll. File all bugs/feature requests at Jekyll’s GitHub repo. If you have questions, you can ask them on Jekyll Talk.