</> Vikas Sharma

How to create blog with Jekyll and Github pages

How to create blog with Jekyll and Github pages


If you always wanted to start your blog and don’t know where to start. Well, just follow this quick guide and by the end of this article, you’ll have your own working blog live on internet (sounds easy right, well it is actually easy. Let’s get to it!).

In this guide, we’ll go through the steps to bring our exciting blog to life (yay!!)

  1. Step 1 - Create GitHub account (in case you already don’t have one) and create a public repository to host our blog’s code. (We’ll use GitHub Pages to host our blog for Free, exciting right!).
  2. Step 2 - Set up Jekyll (a tool to generate static sites using markdown syntax) in your computer. By end of this step, our blog should be up and running.
  3. Step 3 - (By the way, this is an optional step) If you have your own domain, we’ll configure DNS settings to point it to our newly created blog.

Create GitHub Pages repository

          create-new-repository.gif

          repo-visibility-and-gitignore.png

Setup and configure Jekyll

Requirements

Installation

For detailed install instructions, follow the guide for your operating system.

Install Jekyll

After installing Ruby with chruby, let’s install the latest jekyll and bundle gems:

$ gem install jekyll bundler

Create site with Jekyll

$ cd REPOSITORY-NAME
# Changes the working directory
$ jekyll new .
# "." tells jekyll utility to create new site in current directory
$ bundle exec jekyll serve
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.
gem "webrick", "~> 1.7"
$ bundle

GitHub pages - publish settings

          github-settings-tab.png

          jekyll-pages.png

          jekyll-build-and-deployment.png

Congratulations 👏, your blog is live at https://<username>.github.io

[Optional] Configure custom domain

Well, if you already have your own domain or planning to have one, then following steps might interest you.

          github-pages-dns.png

That’s it, we’re done with setup here :) Your custom domain should now point to your newly created blog.

Conclusion

I hope you’re able to successfully set up your blog by following the instructions given in this post. Do let me know in comments, if you find it useful. I’ll try my best to help with any issues that you might face during this setup.

Cheers folks!

References