Permalink
Find file
d368bf5 Oct 13, 2013
@izuzak @russplaysguitar
66 lines (56 sloc) 2.36 KB
---
layout: default
---
<div id="post">
<h1> {{ page.title }} </h1>
<p class="meta"> {{ page.date | date_to_string }} </p>
{{ content }}
</div>
<div id="related">
<h2>Related Posts</h2>
<ul class="posts">
{% for post in site.related_posts limit:3 %}
<li>
<div class="first"><span>{{ post.date | date_to_string }}</span></div>
<div class="sep"> &raquo; </div>
<div class="second"><a href="{{ post.url }}">{{ post.title }}</a></div>
</li>
{% endfor %}
</ul>
</div>
<script type="text/javascript" src="http://datejs.googlecode.com/svn/trunk/build/date-en-US.js"></script>
<script type="text/javascript">
$("#post p").each( function(index) {
if (index > 0 && $.trim($(this).text()).length > 0) {
$(this).attr("id", "par" + index.toString());
var html = $(this).html();
$(this).html(html + " <a href='#par" + index.toString() + "'>#</a>");
}
});
</script>
<div id="comments">
<h2>Comments</h2>
<div id="header">
Want to leave a comment? Visit <a href="https://github.com/izuzak/izuzak.github.com/issues/{{page.commentIssueId}}"> this post's issue page on GitHub</a> (you'll need a GitHub account).
</div>
</div>
<script type="text/javascript">
function loadComments(data) {
for (var i=0; i<data.length; i++) {
var cuser = data[i].user.login;
var cuserlink = "https://www.github.com/" + data[i].user.login;
var clink = "https://github.com/izuzak/izuzak.github.com/issues/{{page.commentIssueId}}#issuecomment-" + data[i].url.substring(data[i].url.lastIndexOf("/")+1);
var cbody = data[i].body_html;
var cavatarlink = data[i].user.avatar_url;
var cdate = Date.parse(data[i].created_at).toString("yyyy-MM-dd HH:mm:ss");
$("#comments").append("<div class='comment'><div class='commentheader'><div class='commentgravatar'>" + '<img src="' + cavatarlink + '" alt="" width="20" height="20">' + "</div><a class='commentuser' href=\""+ cuserlink + "\">" + cuser + "</a><a class='commentdate' href=\"" + clink + "\">" + cdate + "</a></div><div class='commentbody'>" + cbody + "</div></div>");
}
}
$.ajax("https://api.github.com/repos/izuzak/izuzak.github.com/issues/{{page.commentIssueId}}/comments?per_page=100", {
headers: {Accept: "application/vnd.github.full+json"},
dataType: "json",
success: function(msg){
loadComments(msg);
}
});
</script>