Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
83 lines (70 sloc) 2.75 KB
---
layout: default
---
<h1>{{ page.title }}</h1>
<div class="post">
{{ content }}
文章地址: <a href="{{site.url}}{{ page.url }}">{{page.title}}</a>
<div class="attachinfo">
欢迎关注我的微博与我交流:<a href="http://weibo.com/ihubo">@草依山</a>
<br/>
Github上也有一些东西:<a href="https://github.com/jserme/">[Github]</a>
<br/>
<div id="alert">
所有文章坚决抵制<span class="bitch">jb51.net</span>的转载!
</div>
</div>
</div>
<div class="meta">
<div class="tags">
标签:
{% for tag in page.tags %}
<a href="/tag.html#{{tag}}" class="tag">{{tag}} <span class="tagcount">{{site.tags[tag] | size}}</span></a>
{% endfor %}
</div>
<div class="datetime">
<span>{{ page.date | date:"%Y-%m-%d"}}</span>
</div>
</div>
<div class="related-post">
<h2>相关文章</h2>
{% for post in site.related_posts limit:5 %}
<div class="article">
<span class="datetime">{{ post.date | date:"%Y-%m-%d"}}</span>
<a class="title" href="{{ post.url }}">{{ post.title }}</a>
</div>
{% endfor %}
</div>
<div class="post-history">
<h2>文章修改纪录</h2>
<div id="history">加载中...</div>
</div>
<!--动态载入jquery, md5, 然后渲染log-->
<script type="text/javascript">
loadJs('/js/jquery-1.7.2.min.js', function(){
loadJs('/js/md5.min.js', function(){
//取到文章的路径,追加到请求地址上
var articlePath = '{{page.path}}'
var api = 'https://api.github.com/repos/jserme/jserme.github.io/commits?path='
var tmpl = '<div class="article"> <span class="datetime">{date}</span> <span><image src="{src}" title="{author}">{message}</span></div>'
var gravstarurl = 'https://1.gravatar.com/avatar/{md5hash}?s=16'
$.getJSON(api + articlePath,function(data){
if( data.length == 0 ){
$('#history').html('暂无历史纪录 :)');
return false;
}
var history = '';
$.each(data, function(i, v){
var avatar = gravstarurl.replace('{md5hash}', md5(v.commit.author.email));
history += tmpl.replace('{src}', avatar)
.replace('{date}', v.commit.author.date.replace(/T.*Z/,''))
.replace('{message}', v.commit.message);
});
$('#history').html(history);
})
});
});
</script>
<!-- Duoshuo Comment BEGIN -->
<div id="comment" class="ds-thread" data-thread-key="{{page.title}}" data-title="{{page.title}}" data-url="http://jser.me{{page.url}}"></div>
<!-- Duoshuo Comment END -->