After some struggles, I finally built my personal website with GitHub
Pages and Jekyll.
I write this down because I want to leave as a record, and the OS I am using
is CentOS. Therefore, I will use CentOS as demonstration.
You can following the following steps to build your website:
-
Create a repo named
<username>.github.io
.
GitHub Pages only works whenis *exactly* matched to your username. [1] -
Clone the repo create in step #1 to your computer.
-
Install
rvm
.
At first, I wanted to install Ruby viayum
, but I found the version of Ruby installed byyum
is toooooo old. After some searching, I will recommend you to installrvm
because it not only installs newer version of Ruby but also provides as a great manager of your Ruby environments, especilly you are going to learn Ruby of Ruby on Rails later. Most of all, it gets rid of the problem of needingsudo
privilege.
So here are the steps when I was installingrvm
[2]:
(1) install GPG keys:
$ gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
(2) installrvm
:
$ \curl -sSL https://get.rvm.io | bash -s stable
- Install
jekyll
andbundler
.
$ gem install jekyll bundler
- Change into your blog’s directory, namely
<username>.github.io
, and create your website.
$ cd <username>.github.io $ jekyll new .
- Build the website and make it available on a local server.
$ bundle exec jekyll serve
-
Browse to http://localhost:4000.
It shows the following page like this if there is no any problem: -
Push to remote repo mentioned in step #1.
- Browse your website via
<username>.github.io
.
Note that your website may not reply when you push your website repo because it may take some time for GitHub Pages to build your website in the very first time.
Still, if your website does not appear over 30 minutes, you should try to search your problems because it means there is some problems in your website repo.
I hope this post helps you! If you have any question or suggestions to correct this post, please E-mail me to let me know :)
Reference
[2] https://rvm.io/