annhuang

Create a website using Jekyll & Github under 5 minutes

May 05, 2022

Great fun, very useful, and completely free

Here are 10 steps to create a website using Jekyll and host it using Github Pages.

1. Download and install the necessary dependencies:

(a) Ruby (Jekyll is written in Ruby)

  > brew install ruby

(b) Bundler (a development tool that combines JavaScript code files into a single one that is production-ready loadable in the browser)

> gem install bundler

(c) Jekyll (The static site generator)

Install Jekyll using Bundler:

> gem install jekyll

(d) Git (for version control and pushing to GitHub)

2. Choose a theme

3. Download the theme

4. Unzip or extract the files and place them in a directory where you want to manage your Jekyll site

5. Open the files using any code editor

6. Run Jekyll locally

> bundle exec jekyll serve

(a) Create a repository on Github

(b) Initialize a Git repository in your local project

> git init

(c) Connect your local project to GitHub

> git remote add origin https://github.com/your-github-account-name/your-repo-name.git

(d) Add and commit the Files

> git add . 
> git commit -m "Initial commit - Jekyll site"

(e) Push the project to GitHub (it’s either the main branch or the master branch)

> git branch -M main
> git push -u origin main

8. Enable GitHub Pages

9. Final notes

(a) If your theme has extra dependencies, install them with:

> bundle install

(b) To update your site, modify the files, commit changes, and push them to GitHub:

> git add .
> git commit -m "Update site"
> git push origin main

10. Happy blogging!

11. Learn more about working with the folder structures here