How To Build a Jekyll Website

Static site generators are in. They provide security from hackers because there’s no database involved!

Let’s learn how to set up Jekyll and Github together.

1. Install Jekyll

$ gem install jekyll

2. Create a Jekyll website

$ jekyll new mywebsite

3. cd into the newly created folder and start the server

$ cd mywebsite
$ jekyll serve

your website is now running on localhost:4000

4. Host it on github

  1. Create a new repository Github repo
  2. You’ll receive a page just like this one. Copy what’s inside YOUR red box. Jekyll github setup
  3. Go to your terminal and run these commands, first
$ git init
$ git add .
$ git commit -m "my website"

Paste what was inside YOUR red box outlined above into the terminal

$ git remote add origin
$ git push origin master

Click the branch drop down list and create a new branch titled gh-pages Github pages branch

update your local repo to include gh-pages

$ git update

5. Your site is now on github at

But your page wont render correctly until we fix the css link broken github css link

<link rel="stylesheet" href="/MyWebsite/css/main.css">

add and commit your changes

$ git add .
$ git commit -m "fixed css link"

7. Finally run jekyll build and push your repo

$ jekyll build
$ git checkout gh-pages
$ git push origin gh-pages