GitHub Pages + Jekyll == Your Blog

Use GitHub Pages + Jekyll to create your own blog!

This is a shell script

echo ‘hello world!’

Before that, you should install a full Ruby development environment.

  • Ruby version 2.2.5 or above, including all development headers (ruby version can be checked by running ruby -v)
  • RubyGems (which you can check by running gem -v)
  • GCC and Make (in case your system doesn’t have them installed, which you can check by running gcc -v,g++ -v and make -v in your system’s command line interface)

Especially, use RVM to help you install Ruby/Gem easily:

1
2
3
4
5
6
$ gpg --keyserver \
hkp://keys.gnupg.net \
--recv-keys \
409B6B1796C275462A1703113804BB82D39DC0E3 \
7D2BAF1CF37B13E2069D6956105BD0E739499BDB
$ \curl -sSL https://get.rvm.io | bash -s stable --ruby

Then, you should create a new repo named username.github.io, where username is your username(or organization name) on GitHub.

Ok, you first create your blog at localhost:

1
2
3
4
$ gem install jekyll bundler
$ jekyll new myblog
$ cd myblog
$ bundle exec jekyll serve

Visit http://localhost:4000

Rename myblog to username.github.io and enter it:

1
2
3
4
5
$ git init
$ git remote add origin git@github.com:username/username.github.io.git
$ git add .
$ git commit -m "First commit"
$ git push -u origin master

Wait a minute, you can see your own blog at https://username.github.io.

1
2
3
4
5
6
7
8
++ Update on 2018/9/27 ++
Hava a caution when you switch to windows form other systems,
you should use command below to check jekyll(I use git bash):
$ cd your_blog
$ bundle install
$ jekyll -v
Now you can use command below to start local jekyll serve:
$ bundle exec jekyll serve
hsowan wechat
欢迎您扫一扫上面的微信公众号,订阅我的博客!