[GithubPages] Creating a Github Blog in One Day

02. Getting Started

0. Before starting


1. Change your account name to English

If your account name is not in English, you might want to change it in the control panel.

2. Select your IDE

I will be using Visual Studio Code.

3. Install Git

1. Let’s start


Please take a minute to take a look at the following sites.

🔗 https://pages.github.com/

🔗 https://docs.github.com/en/github/working-with-github-pages/getting-started-with-github-pages

We can start by creating a repository in Github. Settings about page can be changed in the repository settings.

Github recommends using “jekyll” as a tool to post and manage your Github Pages. Jekyll is a static site generator written in Ruby. You can learn more about it at 🔗 http://jekyllrb-ko.github.io/

​When learning any languages or tools, we don’t start by reading every detail. Typing it out is the fastest way to learn.

Now that we have located the basic information about the tool, let’s get started by building one by one.

1.1 Finding themes


You can use various themes on Github Pages. People have posted so many jekyll themes, which can be downloaded and applied to your blog with a few clicks.

Jekyll

그림2

Jekyll is a static site generator.

We don’t have time to learn and compose CSS, JS, HTML from the ground. It will be a pain!

Jekyll provides templates that can be customized to our needs and help us focus on posting.

We can simply download a theme we like, edit, post, and compile it with Jekyll, which generates codes, HTML, CSS, JS files. Then, we commit the files to our own github repository which creates a blog!

  • Tool for creating a Static website.

  • Support Markdown -> HTML

  • Many free themes

  • Recommended by GitHub Pages

그림3

Websites where you can download Jekyll themes:

🔗 http://jekyllthemes.org/

🔗 https://jekyllthemes.io/free

🔗 https://jamstackthemes.dev/ssg/jekyll/

🔗 https://jekyll-themes.com/free/

​ You can even create your own theme. Please refer to the page below for tutorials.

🔗 http://jekyllrb-ko.github.io/docs/step-by-step/01-setup/

​ Once you find the theme you like, you can click the download button or use “github clone” to install the file.

Recommended themes:

  1. http://themes.jekyllrc.org/hydejack/

  2. https://jekyllthemes.io/theme/hyde

  3. http://jekyllthemes.org/themes/monos/

  4. http://jekyllthemes.org/themes/panthera-jekyll/

  5. http://jekyllthemes.org/themes/jekyll-theme-prologue/

I personally like having a side-bar for my blog because it allows me to categorize my posts and is very intuitive to visitors, so that that they find the posts they want to read.

In the following episodes, we will be using the first theme “hydejack”​

Most themes follow similar rules, so I would recommend learning the basics with this example then creating your own blog with a different theme.

그림4

Click “Download”.

Create a folder in C Drive and unzip it inside the folder. 그림5

1.2 Install Ruby and jekyll


We need to install Jekyll before we can dit the downloaded files. As said in the previous post, Jekyll is a static compiler. The files (Markdwon, _config.yml, etc.) we edit in texts are converted into a product in _site folder which is then executed on the web via Github.

We need a Ruby environment to install jekyll theme, edit, and manage.

  • Ruby Installation

The reason why we install Ruby is because Jekyll is composed of Ruby. However, we don’t need to know Ruby at all. I don’t have much experience with Ruby but was able to install without any issues.

For Windows, we need to go to the “Ruby Install Page” below and downloaod the one with => symbol.

🔗 https://rubyinstaller.org/downloads/

그림6

그림7

Check all the boxes here.

그림8

Press 1 and hit “enter”.

그림9

It will install everything. Hit “enter” to exit after installation is done.

Open “Cmd” and type “ruby -v” to check that Ruby is installed.

그림10

Right-click on the folder and open visual studio code.

You can open up the console by pressing “Ctrl + ~”

그림11

Type in “chcp 65001”.

This grants encoding. If not run, we will see errors in the following steps.

C:\blog> chcp 65001

Type in “gem install bundler jekyll minima jekyll-feed tzinfo-data rdiscount”.

It will take some time.

C:\blog> gem install bundler jekyll minima jekyll-feed tzinfo-data rdiscount

After it’s done installing:

C:\blog> bundle update --bundler

C:\blog> bundle install

C:\blog> bundle exec jekyll serve

We will see the following output:

그림12

Press “Ctrl + C” twice to exit.

Add the text below to the “Gemfile” located on the left side-bar. Save by pressing “Ctrl + S”.

gem ‘wdm’, ‘>= 0.1.0’

Type in

bundle exec jekyll serve

in the console.

Try http://127.0.0.1:4000/ on your web browser. This will generate a site with the hydejack theme we downloaded!

그림13

In the next post, we will customize our blog.


© 2021. All rights reserved.

Connecting Dots