!This plugin is still in development and not ready for use just yet!
Include src/jquery.hasty.js
from this repository in the head of your
HTML.
Include a theme containing a stylesheet and possible a template file.
You can use the default theme (/theme
) in this repository to get
started.
Call the plugin on the comments container and supply options as needed:
$(function(){
$('#comments').hasty({
// [OPTIONS]
})
});
If you're using the jekyll-hasty gem, the selector will be #comments
.
Github user name.
Defaults to the data-github-user
attribute of the selected element.
Github repository name.
Defaults to the data-github-repo
attribute of the selected element.
Array of sha commit ID hashes. Defining commits relevant for the article at hand. Usually a list of commits changing the article.
Defaults to the data-commit-ids
attribute of the selected element.
The template used by the renderer to display the comments. Supply a
custom template as string, a URL (to load the template via AJAX) or a jQuery object to read the contents of e.g.
a script
tag.
A default template is included in the default theme which will be loaded from
/hasty/themes/default/template.mustache
The renderer used to render the template into HTML. Every custom
renderer must implement a render
method which accepts two arguments:
Mustache.render(template, data)
# template: the template as string
# data: object holding commits and comments
By default Mustache
is used.
Defines how many comments are shown per page.