diff options
author | Valentin Popov <info@valentineus.link> | 2018-10-01 04:09:23 +0300 |
---|---|---|
committer | Valentin Popov <info@valentineus.link> | 2018-10-01 04:13:16 +0300 |
commit | f12fff5aba30ce8af83c36e9acfd060e1a66fadc (patch) | |
tree | 016f84bca7dde9071a018b69074b4127fac2b8fd /_includes/comments.html | |
parent | dbb5bfa521c4a90e343d9e3ab83dde238352cb64 (diff) | |
download | popov.link-f12fff5aba30ce8af83c36e9acfd060e1a66fadc.tar.xz popov.link-f12fff5aba30ce8af83c36e9acfd060e1a66fadc.zip |
Add a link to add comments
Signed-off-by: Valentin Popov <info@valentineus.link>
Diffstat (limited to '_includes/comments.html')
-rw-r--r-- | _includes/comments.html | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/_includes/comments.html b/_includes/comments.html index 30161da..8989970 100644 --- a/_includes/comments.html +++ b/_includes/comments.html @@ -1,4 +1,8 @@ +{% assign repos = site.repos | strip_newlines | strip_html | strip | normalize_whitespace | smartify | xml_escape %} +{% assign issue = page.issue | strip_newlines | strip_html | strip | normalize_whitespace | xml_escape | round %} + {% raw %} +<!-- Template --> <script type="text/html" id="template"> <div class="panel panel-default"> <!-- Title --> @@ -13,26 +17,32 @@ </script> {% endraw %} +<!-- Header --> <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 | smartify | 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); - }); +<!-- List of comments --> +<div id="comments"></div> + +<!-- Script loading comments --> +<script defer type="text/javascript"> + window.addEventListener("load", function () { + Github.getComments("{{ repos }}", "{{ issue }}", + function (error, comments) { + if (error) { throw new Error(error); } + comments.forEach(function (comment) { + Github.addComment("#comments", comment); }); - }); - </script> -</div> + }); + }); +</script> + +<noscript> + <div class="alert alert-warning" role="alert"> + <span>Activate JavaScript to display comments</span> + </div> +</noscript> + +<!-- Button --> +<a href="https://github.com/{{ repos }}/issues/{{ issue }}" class="btn btn-default btn-block" role="button"> + <span>Add a comment</span> +</a> |