1.1 Install Git for Windows:
1.2 Install Ruby for Windows:
1
2
3
4
5
6
7
8
#check ruby installation
ruby -v
#go to DevKit installation directory
ruby dk.rb init
#generate config.yml file, add the installation path of ruby at the end of line, for example:
- D:\J ekyll\R uby22-x64
#then
ruby dk.rb install
1.3 Install Jekyll for Windows:
1
2
gem install bundler
gem install jekyll
2 Create a Blog by Jekyll
1
2
3
4
5
6
jekyll new my-awesome-site
cd my-awesome-site
jekyll serve
# => Now browse to http://localhost:4000
#display default theme: minima
bundle show minima
3 Create GitHub repository for your blog
Reference: GitHub Pages
4 Write Blogs by Markdown
5 Commit to GitHub Repository
1
2
3
4
5
6
7
8
9
10
#clone to local
git clone https://github.com/username/username.github.io
#check files status
git status
#add files modified
git add --all
#commit with comment
git commit -m "comment"
#push to master branch
git push -u origin master
6 Highlight Code
6.1 Select a highlight.css
You can get highlight.css from here
Put it to the path: /assets/highlight.css
Add link in your post.html(or other code that need it)
1
<link rel= "stylesheet" href= "/assets/highlight.css" >
6.2 Add the following code in your _config.yml
6.3 How to use
1
2
3
{ % highlight c ++ linenos % }
your code
{ % endhighlight % }
7 Use Baidu analytics
Register an account of Baidu analytics
Add the following code in your _config.yml
1
baidu_analytics: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Create a file named baidu_analytics.html
1
2
3
4
5
6
7
8
9
<script>
var _hmt = _hmt || [];
( function () {
var hm = document . createElement ( " script " );
hm . src = " https://hm.baidu.com/hm.js?{{ site.baidu_analytics }} " ;
var s = document . getElementsByTagName ( " script " )[ 0 ];
s . parentNode . insertBefore ( hm , s );
})();
</script>
Add the following code in your include/head.html
1
2
3
{% if site.baidu_analytics %}
{% include baidu_analytics.html %}
{% endif %}
8 Source Of My Website