Build and deploy static website

1 minute read

To host website we have different ways and for this blog we are focussing on a use case where we need to have a website for blogging, and we are using:

  • jekyll: static site generator, theme used is minimal mistakes
  • github pages: static website hosting service

Installation

Following are required to be installed in order to build and test the static website locally. Installation instructions here

  1. ruby
  2. rubygems
  3. gcc
  4. make

Prerequisite

Use template repo to get started, we are using minimal-mistakes theme of jeykell, feel free to use any other theme as per need. Download repo

Test if its working fine on local by executing below command and then browsing on localhost:4000

bundle install
bundle exec jekyll serve

Note: config/post can be modified/added as required, follow docs

Configure pages and deploy to github

  1. create new repo and configure github settings to enable pages, follow here
  2. push code to the new created repo
  3. access githubpages url, if the repo created is username.github.io then url will be https:\\username.github.io

Enabling feature to add comments in the blogs

In order to enable comments feature we have different options and here we have used github issues where all the comments in the blog will be stored. To enable, follow here

Note: It will not show comments locally, it will only work once pushed to github on githubpages url.

Comments