var url = "https://github.com/felperez/felperez.github.io/issues/" + {{ $.Params.ghcommentid }} var api_url = "https://api.github.com/repos/felperez/felperez.github.io/issues/" + {{ $.Params.ghcommentid }} + "/comments" $(document).ready(function () { $.ajax(api_url, { headers: {Accept: "application/vnd.github.v3.html+json"}, dataType: "json", success: function(comments) { $("#gh-comments-list").append("Visit the Github Issue to comment on this post"); $.each(comments, function(i, comment) { var date = new Date(comment.created_at); var t = "
"; t += ""; t += "" + comment.user.login + ""; t += " posted at "; t += "" + date.toUTCString() + ""; t += "
"; t += comment.body_html; t += "
"; $("#gh-comments-list").append(t); }); }, error: function() { $("#gh-comments-list").append("Comments are not open for this post yet."); } }); });