Skip to content

Commit

Permalink
update jekyll
Browse files Browse the repository at this point in the history
  • Loading branch information
seraphimhj committed Dec 7, 2012
1 parent 608c7c6 commit 6663927
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
33 changes: 32 additions & 1 deletion _posts/blog/2012-09-09-road-towards-jekyll.md
Expand Up @@ -22,7 +22,38 @@ Jekyll就是这样一项技术。

Jekyll的介绍参见[自带帮助](http://huangjian.info/jekyll-introduction/)

搭乘了Bootstrap架构(前端Javascript框架[E文](http://twitter.github.com/bootstrap/)[中文](http://wrongwaycn.github.com/bootstrap/docs/index.html))的Jekyll,所谓的JB([Jekyll-Bootstrap](http://jekyllbootstrap.com/)),作者是一个年轻小伙,但是功能不凡。值得一提的是,在这里可以快速在GitHub上创建页面,更吸引人的是,ta完全免费。
搭乘了Bootstrap架构(前端Javascript框架[E文](http://twitter.github.com/bootstrap/)[中文](http://wrongwaycn.github.com/bootstrap/docs/index.html))的Jekyll,所谓的JB([Jekyll-Bootstrap](http://jekyllbootstrap.com/)),作者是一个年轻小伙,但是功能不凡。值得一提的是,在这里可以快速在GitHub上创建页面。

下面简单介绍一下利用Jekyll框架定制化多种评论/网站分析等第三方服务。

Jekyll之所以称作框架,就是因为其能满足个人定制化的需求,兼容并包,主要是引入了[YAML](https://github.com/mojombo/jekyll/wiki/YAML-Front-Matter)进行预处理来实现的。

利用YAML可以自定义变量,通过在`_config.yaml`中赋值,在网页中`{{ varname }}`进行调用;

类似于其他语言,可以方便地在网页嵌入一段代码,`{@ include xxx @}` (以下用@代替%);

对配置进行判断,最后选择当前网站采用的服务,下面这个是我的comment文件的写法,从而实现个性化的需求,供参考:

{@ if site.JB.comments.provider @}
{@ case site.JB.comments.provider @}
{@ when "weibo" @}
{@ include JB/comments-providers/weibo @}
{@ when "uyan" @}
{@ include JB/comments-providers/uyan @}
{@ when "disqus" @}
{@ include JB/comments-providers/disqus @}
{@ when "livefyre" @}
{@ include JB/comments-providers/livefyre @}
{@ when "intensedebate" @}
{@ include JB/comments-providers/intensedebate @}
{@ when "facebook" @}
{@ include JB/comments-providers/facebook @}
{@ when "custom" @}
{@ include custom/comments @}
{@ endcase @}
{@ endif @}

当然你也可以直接[fork](https://github.com/seraphimhj/seraphimhj.github.com/fork)我的博客,

Expand Down
2 changes: 1 addition & 1 deletion _posts/blog/2012-11-01-dive-into-code.md
Expand Up @@ -6,6 +6,6 @@ description: 对于一个程序员而言,有时候代码要比参考书更加
keywords: codes,reading,deep
---

可不可以微博一篇。。。
可不可以,微博一篇......


0 comments on commit 6663927

Please sign in to comment.