Github Pages Static Website with Jekyll
What is Jekyll?
Jekyll is a popular static site generator that allows you to build and deploy static websites easily. It was designed to simplify the process of creating simple, fast, and secure websites. Jekyll is built using Ruby and uses the Liquid template language.
Jekyll has a lot of templates that you can use as a base configuration for your website, for this very website that i created, i use Chripy.
How to install and host on Github
Access the Chirpy Starter Github Page, select Use This Template and Create new repository.
If you want your website to be accessible with the url of your github account (eg. helenaferdy.github.io), you have to give it a specific name (username.github.io) like shown down below. Mine is already used so it throws error but yours should be good.
Now we enable github page so the website is hosted on github and accessible on the internet. Access your github repository, go to Settings » Pages and select the branch to be hosted.
And your website should be accessible now.
Customize your website
To do any customization, you can clone the repository to your local machine by running this command
1
git clone link-to-your-repository.git
Open the _config.yml file and edit its values as it suits you.
To run it locally, run this command
1
bundle exec jekyll serve
then your web can be accessed on https://127.0.0.1:4000
To push it to your github repo, simply run these commands
1
2
3
git add .
git coommit -m "your comments"
git push
Add posts
To add posts, create a new file inside the _posts directory. Format the name of your file like this yyyy-mm-dd-name.md
And then you can just write anything you please there. make sure to always have this lines on top of your file as it is used by jekyll as a metadata for your posts.
1
2
3
4
5
6
---
title: Your title
date: 2023-07-12 17:51:00 +0700
categories: [your categories, another categories]
tags: [tag 1, tag 2]
---
And you have your static website done and ready to be served!.