Skip to content

How to use the Github Activity Tracker

Isaac Ballone edited this page Apr 22, 2019 · 1 revision

How to use the Github Activity Tracker

  1. Make sure you have the css. The first is for Github icons and the second is for the widget
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/octicons/2.0.2/octicons.min.css">
<link rel="stylesheet" href="{{"assets/css/github-activity.css" | relative_url}}">
  1. Make sure you got the Javascript. Mustache is for templating and the second is for the widget
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/mustache.js/0.7.2/mustache.min.js"></script>
<script type="text/javascript" src="{{"assets/js/github-activity.js" | relative_url}}"></script>
  1. Create a root tag and place it where you want your activity tracker.
<div id="myAwesomeFeed" style="height: 500px;"></div>
  1. Finally, create the feed at the bottom with. You MUST include username, repository, and selector!
<script>
GitHubActivity.feed({
    username: "msoe-sse",
    repository: "msoe-sse.github.io",
    selector: "#myAwesomefeed",  // Should match the tag id used above
    limit: 20  // Optional, you can remove this
});
</script>
  1. You're done!

Clone this wiki locally