Create an attribute called data-repo
:
<div data-repo="jquery-boilerplate/boilerplate"></div>
Include jQuery:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
Include plugin's CSS and JS:
<link rel="stylesheet" href="assets/base.css">
<script src="jquery.github.min.js"></script>
Call the plugin:
$("[data-repo]").github();
And that's it \o/
Check full example's source code.
Here's a list of available settings.
$("[data-repo]").github({
iconStars: true,
iconForks: true,
iconIssues: false
});
Type: Boolean
Default: true
Display the number of stars in a repository.
Type: Boolean
Default: true
Display the number of forks in a repository.
Type: Boolean
Default: false
Display the number of issues in a repository.
Have you used this plugin in your project?
Let me know! Send a tweet or pull request and I'll add it here :)
Prefer a non-jquery version with pure JavaScript?
No problem, @ricardobeat already did one. Check his fork!
Check CONTRIBUTING.md.
Check HISTORY.md.
Built on top of jQuery Boilerplate