Create a simple blog on the GitHub Pages

Posted by Java developer blog on October 6, 2016

I wrote a post about how to create a simple and free blog with help of the GitHub Pages.

I used Ubuntu 16.04 x64.

I described all steps below:

1) Install all requirements:

1
2
3
sudo apt-get install ruby-dev
sudo apt-get install zlib1g-dev
sudo apt-get install nodejs

2) fork the following project:

1
https://github.com/jekyll/minima

3) Rename the project to the “username.github.io”.

4) git clone the project above in a dicrectory.

5) Run the following command in the directory:

1
bundle install

6) Copy all files (except “_posts” folder) from the example directory to the root folder of the project.

Delete example directory.

7) Add a post to the “_post” directory.

8) Edit _config.yml file

Replace

1
baseurl: "/minima"

by

1
baseurl: ""

You could also edit other filds in the files as needed.

9) Run a server by the command:

1
bundle exec jekyll serve

10) Check the server by opening the web page:

1
http://localhost:4000

11) Сommit all changes.

12) Check the following web page:

1
username.github.io

13) Add Disqus support:

a) register on the site.

b) find disqus shortname, more info is provided by the following link.

c) add to the _config.yml file the following code:

1
2
disqus:
    shortname: YOU_DISQUS_SHORT_NAME

14) Add Google Alytics support:

a) register on the site.

b) add to the _config.yml file the following code:

1
google_analytics: UA-********-*

where UA-***- - it is your Tracking ID.

15) Add an image to a post.

To add an image to a post you should put a picture in the follwowing folder

1
root_folder/assets

Then add the image to the post by

1
![](\{\{ site.url \}\}/assets/image.jpg)

where image.jpg is a name of the post and {{ site.url }} is just a variable which contains your site url.

Don’t forget to delete “\” symbols.

Additional links:

pages.github

setting-up-your-github-pages-site-locally-with-jekyll

jekyllrb-docs-posts

mastering-markdown

simple-social-media-links-jekyll