搭建github pages

知识百科

喜欢写blog的人,会经历3个阶段:

> 第1阶段刚接触Blog,觉得很新鲜,试着选择一个免费空间来写,比如博客园、网易博客等;
> 第2阶段发现免费空间限制太多,就自己购买域名和空间,搭建独立博客;
> 第3阶段觉得独立博客的管理太麻烦,最好在保留控制权的前提下,让别人来管,自己只负责写文章;

大多数blog作者,都停留在第1和第2阶段,因为觉得第3阶段不太容易到达,但是最近很多程序员开始在github网站上搭建blog,进入了第3阶段。

搭建示例

(1)github上创建项目,例如我的例子就是cjhust/blog;
(2)初始化项目,创建gh-pages分支


   #git clone git@github.com:cjhust/blog.git
   #git init
   #git checkout --orphan gh-pages
   #echo "# github pages" >> READM.md
   #git add .
   #git commit -m "first commit"
   #git push origin gh-pages

(3)打开项目https://github.com/cjhust/pages,settings->github pages->lauch automatic page generator->publish page,根据默认的模板生成项目;
(4)访问网站:https://cjhust.github.io/pages/,即可看到内容;(如果没成功,会向你注册的email发邮件的)
(5)https://github.com/niklasbuschmann/contrast.git
(5)搭建jekyll博客系统,详见http://www.ruanyifeng.com/blog/2012/08/blogging_with_jekyll.html

jekyll主题

https://github.com/luoyan35714/LessOrMore(成功)
https://github.com/WakelessDragon/blog
https://github.com/niklasbuschmann/contrast(黑白)
https://github.com/pizn/kunka
https://github.com/likebeta/blog
https://github.com/liberize/liberize.github.com
https://github.com/panxw/panxw.github.com

jekyll语法

CNAME文件里写上www.cjhust.com,访问cjhust.githu.io/blog时会跳转

参考资料

阮一峰的博客: 搭建一个免费的,无限量的blog

posted @ 2016-10-24 10:05  陈洁(盛颜)  阅读(166)  评论(0)    收藏  举报