aboutsummaryrefslogtreecommitdiff
path: root/_includes/comments.html
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2018-09-30 06:26:49 +0300
committerValentin Popov <info@valentineus.link>2018-09-30 06:26:49 +0300
commitbdaafc3d36e1529ce5471fa1358f90ffcf715dd9 (patch)
tree2a19ac50fe16386ce18c158a307887e31e8978a5 /_includes/comments.html
parent75605da179fa7333033632a6051f5360cb955a2c (diff)
downloadpopov.link-bdaafc3d36e1529ce5471fa1358f90ffcf715dd9.tar.xz
popov.link-bdaafc3d36e1529ce5471fa1358f90ffcf715dd9.zip
Template of comments
Signed-off-by: Valentin Popov <info@valentineus.link>
Diffstat (limited to '_includes/comments.html')
-rw-r--r--_includes/comments.html38
1 files changed, 38 insertions, 0 deletions
diff --git a/_includes/comments.html b/_includes/comments.html
new file mode 100644
index 0000000..c8f252a
--- /dev/null
+++ b/_includes/comments.html
@@ -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>