From 55b6896627751bf5fcba9699f918de60af5abb9e Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Wed, 4 Oct 2017 16:04:24 -0400 Subject: [PATCH] Add support for Staticman v2 endpoint and reCAPTCHA Ref: #803 --- .../comments-providers/staticman_v2.html | 42 +++++++++++ _includes/comments.html | 72 +++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 _includes/comments-providers/staticman_v2.html diff --git a/_includes/comments-providers/staticman_v2.html b/_includes/comments-providers/staticman_v2.html new file mode 100644 index 0000000..471fa86 --- /dev/null +++ b/_includes/comments-providers/staticman_v2.html @@ -0,0 +1,42 @@ +{% if site.repository and site.staticman.branch %} + +{% endif %} \ No newline at end of file diff --git a/_includes/comments.html b/_includes/comments.html index 332374e..a2bd2db 100644 --- a/_includes/comments.html +++ b/_includes/comments.html @@ -91,6 +91,78 @@ {% endif %} + {% when "staticman_v2" %} +
+ {% if site.repository and site.staticman.branch %} + +
+ {% if site.data.comments[page.slug] %} +

{{ site.data.ui-text[site.locale].comments_title | default: "Comments" }}

+ {% assign comments = site.data.comments[page.slug] | sort %} + + {% for comment in comments %} + {% assign email = comment[1].email %} + {% assign name = comment[1].name %} + {% assign url = comment[1].url %} + {% assign date = comment[1].date %} + {% assign message = comment[1].message %} + {% include comment.html index=forloop.index email=email name=name url=url date=date message=message %} + {% endfor %} + {% endif %} +
+ + + +
+

{{ site.data.ui-text[site.locale].comments_label | default: "Leave a Comment" }}

+

{{ site.data.ui-text[site.locale].comment_form_info | default: "Your email address will not be published. Required fields are marked" }} *

+
+
+ + {{ site.data.ui-text[site.locale].loading_label | default: "Loading..." }} +
+ +
+ + + +
+
+ + +
+
+ + +
+
+ + +
+ + + + +
+
+
+
+ +
+
+
+ + {% if site.reCaptcha.siteKey %}{% endif %} + {% endif %} +
{% when "custom" %}
{% endcase %} -- 2.43.0