2016-03-23 21:33:21 +01:00
< div class = "page__comments" >
2016-08-11 16:14:27 +02:00
{% capture comments_label %}{{ site.data.ui-text[site.locale].comments_label | default: "Comments" }}{% endcapture %}
2017-10-05 15:56:54 +02:00
{% case site.comments.provider %}
{% when "discourse" %}
< h4 class = "page__comments-title" > {{ comments_label }}< / h4 >
< section id = "discourse-comments" > < / section >
{% when "disqus" %}
< h4 class = "page__comments-title" > {{ comments_label }}< / h4 >
< section id = "disqus_thread" > < / section >
{% when "facebook" %}
< h4 class = "page__comments-title" > {{ comments_label }}< / h4 >
< section class = "fb-comments" data-href = "{{ page.url | absolute_url }}" data-mobile = "true" data-num-posts = "{{ site.comments.facebook.num_posts | default: 5 }}" data-width = "100%" data-colorscheme = "{{ site.comments.facebook.colorscheme | default: 'light' }}" > < / section >
{% when "staticman_v2" %}
< section id = "static-comments" >
2019-12-19 17:38:51 +01:00
{% if site.repository and site.comments.staticman.branch %}
2017-10-05 15:56:54 +02:00
<!-- Start static comments -->
< div class = "js-comments" >
{% if site.data.comments[page.slug] %}
< h4 class = "page__comments-title" > {{ site.data.ui-text[site.locale].comments_title | default: "Comments" }}< / h4 >
2021-10-19 17:23:42 +02:00
{% assign comments = site.data.comments[page.slug] %}
2016-08-11 16:14:27 +02:00
2021-10-19 17:23:42 +02:00
<!-- In order to sort by date we must have an array of objects, not an array of arrays, so
create a new array of plain comment objects and then sort by the comment date. -->
{% assign commentObjects = '' | split: '' %}
2017-10-05 15:56:54 +02:00
{% for comment in comments %}
2021-10-19 17:23:42 +02:00
{% assign commentObject = comment[1] %}
{% assign commentObjects = commentObjects | push: commentObject %}
{% endfor %}
{% assign comments = commentObjects | sort: "date" %}
{% for comment in comments %}
{% assign email = comment.email %}
{% assign name = comment.name %}
{% assign url = comment.url %}
{% assign date = comment.date %}
{% assign message = comment.message %}
2017-10-05 15:56:54 +02:00
{% include comment.html index=forloop.index email=email name=name url=url date=date message=message %}
{% endfor %}
{% endif %}
< / div >
<!-- End static comments -->
2016-08-11 16:14:27 +02:00
2017-10-05 15:56:54 +02:00
<!-- Start new comment form -->
< div class = "page__comments-form" >
< h4 class = "page__comments-title" > {{ site.data.ui-text[site.locale].comments_label | default: "Leave a Comment" }}< / h4 >
< p class = "small" > {{ site.data.ui-text[site.locale].comment_form_info | default: "Your email address will not be published. Required fields are marked" }} < span class = "required" > *< / span > < / p >
2021-04-13 21:55:51 +02:00
< form id = "new_comment" class = "page__comments-form js-form form" method = "post" action = "{{ site.comments.staticman.endpoint }}{{ site.repository }}/{{ site.comments.staticman.branch }}/comments" >
2017-10-05 15:56:54 +02:00
< div class = "form__spinner" >
2018-01-04 20:27:27 +01:00
< i class = "fas fa-spinner fa-spin fa-3x fa-fw" > < / i >
2017-10-05 15:56:54 +02:00
< span class = "sr-only" > {{ site.data.ui-text[site.locale].loading_label | default: "Loading..." }}< / span >
< / div >
2016-08-10 22:08:13 +02:00
2017-10-05 15:56:54 +02:00
< div class = "form-group" >
< label for = "comment-form-message" > {{ site.data.ui-text[site.locale].comment_form_comment_label | default: "Comment" }} < small class = "required" > *< / small > < / label >
< textarea type = "text" rows = "3" id = "comment-form-message" name = "fields[message]" tabindex = "1" > < / textarea >
< div class = "small help-block" > < a href = "https://daringfireball.net/projects/markdown/" > {{ site.data.ui-text[site.locale].comment_form_md_info | default: "Markdown is supported." }}< / a > < / div >
< / div >
< div class = "form-group" >
< label for = "comment-form-name" > {{ site.data.ui-text[site.locale].comment_form_name_label | default: "Name" }} < small class = "required" > *< / small > < / label >
< input type = "text" id = "comment-form-name" name = "fields[name]" tabindex = "2" / >
< / div >
< div class = "form-group" >
< label for = "comment-form-email" > {{ site.data.ui-text[site.locale].comment_form_email_label | default: "Email address" }} < small class = "required" > *< / small > < / label >
< input type = "email" id = "comment-form-email" name = "fields[email]" tabindex = "3" / >
< / div >
< div class = "form-group" >
< label for = "comment-form-url" > {{ site.data.ui-text[site.locale].comment_form_website_label | default: "Website (optional)" }}< / label >
< input type = "url" id = "comment-form-url" name = "fields[url]" tabindex = "4" / >
< / div >
< div class = "form-group hidden" style = "display: none;" >
< input type = "hidden" name = "options[slug]" value = "{{ page.slug }}" >
< label for = "comment-form-location" > Not used. Leave blank if you are a human.< / label >
< input type = "text" id = "comment-form-location" name = "fields[hidden]" autocomplete = "off" / >
2018-03-31 00:39:54 +02:00
{% if site.reCaptcha.siteKey %}< input type = "hidden" name = "options[reCaptcha][siteKey]" value = "{{ site.reCaptcha.siteKey }}" > {% endif %}
{% if site.reCaptcha.secret %}< input type = "hidden" name = "options[reCaptcha][secret]" value = "{{ site.reCaptcha.secret }}" > {% endif %}
2017-10-05 15:56:54 +02:00
< / div >
<!-- Start comment form alert messaging -->
< p class = "hidden js-notice" >
< strong class = "js-notice-text" > < / strong >
< / p >
<!-- End comment form alert messaging -->
2018-03-31 00:39:54 +02:00
{% if site.reCaptcha.siteKey %}
< div class = "form-group" >
< div class = "g-recaptcha" data-sitekey = "{{ site.reCaptcha.siteKey }}" > < / div >
< / div >
{% endif %}
2017-10-05 15:56:54 +02:00
< div class = "form-group" >
< button type = "submit" id = "comment-form-submit" tabindex = "5" class = "btn btn--primary btn--large" > {{ site.data.ui-text[site.locale].comment_btn_submit | default: "Submit Comment" }}< / button >
< / div >
< / form >
< / div >
<!-- End new comment form -->
{% if site.reCaptcha.siteKey %}< script async src = "https://www.google.com/recaptcha/api.js" > < / script > {% endif %}
{% endif %}
< / section >
{% when "staticman" %}
< section id = "static-comments" >
{% if site.repository and site.staticman.branch %}
<!-- Start static comments -->
< div class = "js-comments" >
{% if site.data.comments[page.slug] %}
< h4 class = "page__comments-title" > {{ site.data.ui-text[site.locale].comments_title | default: "Comments" }}< / h4 >
2021-10-19 17:23:42 +02:00
{% assign comments = site.data.comments[page.slug] %}
<!-- In order to sort by date we must have an array of objects, not an array of arrays, so
create a new array of plain comment objects and then sort by the comment date. -->
{% assign commentObjects = '' | split: '' %}
{% for comment in comments %}
{% assign commentObject = comment[1] %}
{% assign commentObjects = commentObjects | push: commentObject %}
{% endfor %}
{% assign comments = commentObjects | sort: "date" %}
2017-10-04 22:04:24 +02:00
2017-10-05 15:56:54 +02:00
{% for comment in comments %}
2021-10-19 17:23:42 +02:00
{% assign email = comment.email %}
{% assign name = comment.name %}
{% assign url = comment.url %}
{% assign date = comment.date %}
{% assign message = comment.message %}
2017-10-05 15:56:54 +02:00
{% include comment.html index=forloop.index email=email name=name url=url date=date message=message %}
{% endfor %}
{% endif %}
< / div >
<!-- End static comments -->
2017-10-04 22:04:24 +02:00
2017-10-05 15:56:54 +02:00
<!-- Start new comment form -->
< div class = "page__comments-form" >
< h4 class = "page__comments-title" > {{ site.data.ui-text[site.locale].comments_label | default: "Leave a Comment" }}< / h4 >
< p class = "small" > {{ site.data.ui-text[site.locale].comment_form_info | default: "Your email address will not be published. Required fields are marked" }} < span class = "required" > *< / span > < / p >
< form id = "new_comment" class = "page__comments-form js-form form" method = "post" action = "https://api.staticman.net/v1/entry/{{ site.repository }}/{{ site.staticman.branch }}" >
< div class = "form__spinner" >
2018-01-04 20:27:27 +01:00
< i class = "fas fa-spinner fa-spin fa-3x fa-fw" > < / i >
2017-10-05 15:56:54 +02:00
< span class = "sr-only" > {{ site.data.ui-text[site.locale].loading_label | default: "Loading..." }}< / span >
< / div >
2017-10-04 22:04:24 +02:00
2017-10-05 15:56:54 +02:00
< div class = "form-group" >
< label for = "comment-form-message" > {{ site.data.ui-text[site.locale].comment_form_comment_label | default: "Comment" }} < small class = "required" > *< / small > < / label >
< textarea type = "text" rows = "3" id = "comment-form-message" name = "fields[message]" tabindex = "1" > < / textarea >
< div class = "small help-block" > < a href = "https://daringfireball.net/projects/markdown/" > {{ site.data.ui-text[site.locale].comment_form_md_info | default: "Markdown is supported." }}< / a > < / div >
< / div >
< div class = "form-group" >
< label for = "comment-form-name" > {{ site.data.ui-text[site.locale].comment_form_name_label | default: "Name" }} < small class = "required" > *< / small > < / label >
< input type = "text" id = "comment-form-name" name = "fields[name]" tabindex = "2" / >
< / div >
< div class = "form-group" >
< label for = "comment-form-email" > {{ site.data.ui-text[site.locale].comment_form_email_label | default: "Email address" }} < small class = "required" > *< / small > < / label >
< input type = "email" id = "comment-form-email" name = "fields[email]" tabindex = "3" / >
< / div >
< div class = "form-group" >
< label for = "comment-form-url" > {{ site.data.ui-text[site.locale].comment_form_website_label | default: "Website (optional)" }}< / label >
< input type = "url" id = "comment-form-url" name = "fields[url]" tabindex = "4" / >
< / div >
< div class = "form-group hidden" style = "display: none;" >
< input type = "hidden" name = "options[slug]" value = "{{ page.slug }}" >
< label for = "comment-form-location" > Not used. Leave blank if you are a human.< / label >
< input type = "text" id = "comment-form-location" name = "fields[hidden]" autocomplete = "off" / >
< / div >
<!-- Start comment form alert messaging -->
< p class = "hidden js-notice" >
< strong class = "js-notice-text" > < / strong >
< / p >
<!-- End comment form alert messaging -->
< div class = "form-group" >
< button type = "submit" id = "comment-form-submit" tabindex = "5" class = "btn btn--primary btn--large" > {{ site.data.ui-text[site.locale].comment_btn_submit | default: "Submit Comment" }}< / button >
< / div >
< / form >
< / div >
<!-- End new comment form -->
{% endif %}
< / section >
2018-11-21 20:59:14 +01:00
{% when "utterances" %}
< h4 class = "page__comments-title" > {{ comments_label }}< / h4 >
< section id = "utterances-comments" > < / section >
2021-07-05 22:08:28 +02:00
{% when "giscus" %}
< h4 class = "page__comments-title" > {{ comments_label }}< / h4 >
< section id = "giscus-comments" > < / section >
2017-10-05 15:56:54 +02:00
{% when "custom" %}
2020-06-03 04:33:08 +02:00
{% include /comments-providers/custom.html %}
2016-03-23 21:33:21 +01:00
{% endcase %}
2018-09-21 15:49:58 +02:00
< / div >