0%

Use jekyll to create a blog on github

Install jekyll firstly https://pcjustin.github.io/2017/09/17/install-jekyll-on-mac.html

And following the simple way to create your own blog.

1
2
3
$ jekyll new my-awesome-site
$ cd my-awesome-site
$ jekyll s

How to create a post

  • create a folder names ‘_posts’
  • add a post names ‘2017-01-01-my-first-blog.md’
  • use markdown to write something
1
2
3
4
5
6
---
layout: post
title: my first blog
---

This is my first post.

How to modify blog name and something else

modify _config.yml

This file include many features what you want to.

1
2
3
title: My blog
author: My name
email: my@email.com

Create more information

Modify about.md

1
2
3
4
5
6
7
---
layout: page
title: About
permalink: /about/
---

This is my information.

How to publish the post to github

  • create a blog in github https://pages.github.com/
  • publish the post to github
    1
    2
    3
    $ git add _posts
    $ git commit -m "my first blog"
    $ git push -u origin master

    How to add page views

Many ways to support visitors counter and post views in your blog. Please following the simple way to support it.

create the own layout

Copy the ‘_includes’ and ‘_layouts’ to your blog. In Mac, you can use the command to find out the folder.

1
$ open $(bundle show minima)

add external javascript in head.html

1
<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
1
2
3
4
5
6
<div class="footer-col footer-col-3">
<p>{{ site.description | escape }}</p>
<span id="busuanzi_container_site_pv">
Visitors: <span id="busuanzi_value_site_pv"></span>
</span>
</div>

add page views in post.html

1
2
3
4
<p class="post-meta">
<span id="busuanzi_container_page_pv">
View: <span id="busuanzi_value_page_pv">
</span></span></p>

Something else

Now you can create the own blog or copy others into your blog.

If you want to learn how to use markdown for writing your post, you can following the link.

And you can find out more templates for improving the layout.