51 lines
1.8 KiB
HTML
51 lines
1.8 KiB
HTML
---
|
|
layout: default
|
|
---
|
|
|
|
<!--<div id="gh-latest"></div>-->
|
|
<div class="posts">
|
|
{% for post in site.posts %}
|
|
<article class="post">
|
|
|
|
<h1><a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a></h1>
|
|
|
|
<div>
|
|
<p class="post_date">{{ post.date | date: "%B %e, %Y" }}</p>
|
|
</div>
|
|
|
|
<div class="entry">
|
|
{{ post.excerpt }}
|
|
</div>
|
|
|
|
<a href="{{ site.baseurl }}{{ post.url }}" class="read-more">Read More</a>
|
|
</article>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
<script>
|
|
/*var xmlhttp = new XMLHttpRequest();
|
|
var userMetaURL = "https://api.github.com/users/yourusername/events";
|
|
xmlhttp.onreadystatechange = function () {
|
|
if (this.readyState == 4 && this.status == 200) {
|
|
var userMeta = JSON.parse(this.responseText);
|
|
|
|
for(let i = 0; i < userMeta.length; i++){
|
|
if(userMeta[i].type == 'PushEvent'){
|
|
var commitURL = userMeta[i].payload.commits[0].url.replace('api.', '').replace('repos/', '').replace('commits', 'commit');
|
|
var projectURL = userMeta[i].repo.url.replace('api.', '').replace('repos/', '');
|
|
var commitMessage = userMeta[i].payload.commits[0].message;
|
|
var projectName = userMeta[i].repo.name;
|
|
var commitDate = new Date(userMeta[i].created_at).toDateString();
|
|
|
|
var ghLatestActivity = '<a class="chip yellow lighten-2">Latest commit</a>"' + '<a class="text-link" href="' + commitURL + '"' + '>' + commitMessage + '</a>' + '" at ' + '<a class="text-link" href="' + projectURL + '"' + '>' + projectName + '</a>' + ' on ' + commitDate + '.';
|
|
|
|
document.getElementById("gh-latest").innerHTML = ghLatestActivity;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
};
|
|
xmlhttp.open("GET", userMetaURL, true);
|
|
xmlhttp.send();*/
|
|
</script>
|