Template of comments
Signed-off-by: Valentin Popov <info@valentineus.link>
This commit is contained in:
parent
75605da179
commit
bdaafc3d36
38
_includes/comments.html
Normal file
38
_includes/comments.html
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
{% raw %}
|
||||||
|
<script type="text/html" id="template">
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<!-- Title -->
|
||||||
|
<div class="panel-heading">
|
||||||
|
<img class="github-avatar img-rounded" src="{{= it.avatar }}">
|
||||||
|
<a href="{{= it.url }}"><strong>{{= it.user }}</strong></a>
|
||||||
|
<span>commented on {{= it.date }}</span>
|
||||||
|
</div>
|
||||||
|
<!-- Content -->
|
||||||
|
<div class="panel-body">{{= it.content }}</div>
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
|
<h2>Comments</h2>
|
||||||
|
<div id="comments">
|
||||||
|
<noscript>
|
||||||
|
<div class="alert alert-warning" role="alert">
|
||||||
|
<span>Activate JavaScript to display comments</span>
|
||||||
|
</div>
|
||||||
|
</noscript>
|
||||||
|
|
||||||
|
<!-- Script loading comments -->
|
||||||
|
<script defer type="text/javascript">
|
||||||
|
window.addEventListener("load", function () {
|
||||||
|
Github.getComments(
|
||||||
|
"{{ site.repos | strip_newlines | strip_html | strip | normalize_whitespace | slugify | xml_escape }}",
|
||||||
|
"{{ page.issue | strip_newlines | strip_html | strip | normalize_whitespace | xml_escape | round }}",
|
||||||
|
function (error, comments) {
|
||||||
|
if (error) { throw new Error(error); }
|
||||||
|
comments.forEach(function (comment) {
|
||||||
|
Github.addComment("#comments", comment);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</div>
|
Loading…
Reference in New Issue
Block a user