Create a blog under GitHub Pages using Jekyll
Blogs are very useful for Ph.D.s to show some innovative ideas, technical tutorials, and some interesting stories. Create a blog under the GitHub Pages is really easy by introducing some static site generator like “Jekyll”. In this post, I will guide you to create a blog page on your GitHub website using Jekyll.
Start creating your blog from Poole
Jekyll is a static site generator, an open-source tool for creating simple yet powerful websites of all shapes and sizes. Poole is the butler for Jekyll. It provides a clear and concise foundational setup for any Jekyll site.
Here, I assume you have set up a GitHub Page under a GitHub repository <username>.github.io
. You can refer to GitHub Pages tutorial to create your personal website. I downloaded a website template from html5up and you can also find many great templates there.
Clone from Poole GitHub repository:
Create a blog repository on GitHub
Now, we are going to create a blog using Poole at https://<username>.github.io/blog/
.
- Create a new repository on GitHub named
blog
. - Remove original remote from Poole:
- Add the remote Github repository
blog
:
Set basic configurations
Basic configurations are written in the file _config.yml
. Here is my settings:
baseurl
can be set as any sub-URL that you want your blog running at.
Running Jekyll on your local machine
Install Jekyll on your machine using gem
:
Run Jekyll server on your machine:
You will get something in the terminal like following:
Now, you can visit your blog at http://127.0.0.1:4000/blog/
.
Push changes to gh-pages
branch
Then, you need to push the changes to the GitHub repository blog
. In order to show the blog at https://<username>.github.io/blog
, you need to push all changes to gh-pages
branch.
Create a new branch named gh-pages
:
Push the changes to the repository:
References
- https://jekyllrb.com/docs/home/
- http://romantsegelskyi.github.io/blog/2015/07/26/personal-page-blog/
jekyll
blog