Setting up GitHub Pages site
There are lots of guidences on internet about how to set up GitHub Pages site locally with Jekyll. However, there are also lots of mistakes. Here is my way on Jekyll.
1.Start a "Hello World" project
Following the preference on Official Site
2.Run the project locally.
Install Ruby and DevKit. Chinese Guide
- Choose an apropriate release on rubyinstaller and install it
- Download a matching DevKit on the same site and unzip it under the Ruby install path
- Change derectory into DevKit and run
ruby dk.rb init
- Config "config.yml" by adding Ruby path on the end, eg."- C:\Programs\Ruby23"
- Install DevKit by running
ruby dk.rb install
Install Jekyll and Rouge
- Change the source by run a cmd:
gem sources -a http://gems.ruby-china.org/ --remove https://rubygems.org/
In China, It's unstable to visit the origin source https://rubygems.org/. And if it failed, change the "https://gems.ruby-china.org/" into "http://gems.ruby-china.org/" gem install jekyll
gem install rouge
Start a local project with Jekyll
- Following the preference on Official Guide
3.Apply a template to the project
Download a template on jekyllthemes.
Your can read "README.md" in the template folder. There are also two guid: jekyllcn Chinese Guide, jekyllrb English Guide
4.Modify the template
My templeate is fengzhichu. A important part is Mathjax.
Add the following code on the body of in "post.html"
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
jax: ["input/TeX","input/MathML","input/AsciiMath","output/CommonHTML"],
tex2jax: {inlineMath: [['$','$']], displayMath: [['$$','$$']]}
});
</script>
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>