diff --git a/_config.yml b/_config.yml index eb0ac069..5c6d9733 100644 --- a/_config.yml +++ b/_config.yml @@ -18,6 +18,8 @@ baseurl: "" url: "https://zbabystack.netlify.com" repository: moxiegirl/docs.blockstack +staticman: + branch: "master" github_editme_path: moxiegirl/docs-new/blob/master # if you're using Github, provide the basepath to the branch you've created for reviews, following the sample here. if not, leave this value blank. @@ -62,8 +64,8 @@ footer: copyright: Blockstack # Disqus comments shortname, requires Disqus account https://disqus.com/ -disqus: - shortname: # 1234 +# disqus: +# shortname: # 1234 # Google analytics code, get your code here https://www.google.com/analytics/ google_analytics: @@ -110,6 +112,12 @@ exclude: sass: style: compressed +defaults: + - scope: + path: "" # an empty string here means all files in the project + values: + comments: true + collections: android: output: true diff --git a/_includes/comment-form.html b/_includes/comment-form.html new file mode 100644 index 00000000..8ed51181 --- /dev/null +++ b/_includes/comment-form.html @@ -0,0 +1,51 @@ +{% unless page.comments_locked == true %} + +
+
+

Leave a Comment

+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ + + + +
+
+ + +
+
+
+ + +{% else %} +

Comments are closed. If you have a question concerning the content of this page, please feel free to contact me.

+{% endunless %} diff --git a/_includes/comment.html b/_includes/comment.html index 06ae0599..1821c4ce 100644 --- a/_includes/comment.html +++ b/_includes/comment.html @@ -1,35 +1,36 @@
-
+
{% if include.avatar %} - {{ include.name | escape }} + + {% elsif include.email %} - {{ include.name | escape }} + + {% else %} - {{ include.name | escape }} + + {% endif %}
-

+

{% unless include.url == blank %} - - {% if include.name == site.author.name %} {% endif %}{{ include.name }} - + {{ include.name | strip_html }} {% else %} - {% if include.name == site.author.name %} {% endif %}{{ include.name }} + {{ include.name | strip_html }} {% endunless %}

-
+ -
+
{{ include.message | markdownify }}
{% unless include.replying_to != 0 or page.comments_locked == true %} -
diff --git a/_includes/comment__form.html b/_includes/comment__form.html index 3b39ef0d..45bc2abe 100644 --- a/_includes/comment__form.html +++ b/_includes/comment__form.html @@ -1,29 +1,56 @@ -
-
- - -
-
- - -
-
- - -
-
- - -
- -
- -
-
- +{% if page.comments == true %} +
+ {% if site.repository and site.staticman.branch %} + {% if site.data.comments[page.slug] %} + +
+

Comments

+ {% assign comments = site.data.comments[page.slug] | sort %} + {% for comment in comments %} + {% assign avatar = comment[1].avatar %} + {% 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 avatar=avatar email=email name=name url=url date=date message=message %} + {% endfor %} +
+ + {% endif %} + + +

Leave a Comment

+

Your email address will not be published. Required fields are marked *

+
+
+ + + + +
+
+ + +
+
+ + +
+ + + + +
+ +
+
+ + {% endif %} +
+{% endif %} diff --git a/_includes/comments.html b/_includes/comments.html new file mode 100644 index 00000000..705c5dfd --- /dev/null +++ b/_includes/comments.html @@ -0,0 +1,27 @@ +
+ {% if site.repository and site.staticman.branch %} + {% if site.data.comments[page.slug] %} + +
+
+

{% if site.data.comments[page.slug].size > 1 %}{{ site.data.comments[page.slug] | size | append: ' ' }}{% endif %}Comments

+
+ {% assign comments = site.data.comments[page.slug] | sort | where_exp: 'comment', 'comment[1].replying_to == blank' %} + {% for comment in comments %} + {% assign index = forloop.index %} + {% assign replying_to = comment[1].replying_to | to_integer %} + {% assign avatar = comment[1].avatar %} + {% 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=index replying_to=replying_to avatar=avatar email=email name=name url=url date=date message=message %} + {% endfor %} +
+ + {% endif %} + + {% include comment-form.html %} + {% endif %} +
diff --git a/_includes/footer.html b/_includes/footer.html index 86d5bae1..634327e4 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -1,7 +1,7 @@ diff --git a/_layouts/auth.html b/_layouts/auth.html index b5596386..7b4b7799 100644 --- a/_layouts/auth.html +++ b/_layouts/auth.html @@ -56,11 +56,12 @@ layout: default {% include paginate-doc.html %} - {% include related-auth.html %} + - {% include comment__form.html %} + {% if page.comments == true %} + {% include comments.html %} + {% endif %} - {% include page__comments.html %} +{"description":"Android SDK Tutorial (Pre-release)","author":{"@type":"Person","name":"Blockstack"},"@type":"BlogPosting","url":"http://localhost:4000/android/tutorial.html","headline":"Android SDK Tutorial (Pre-release)","dateModified":"2018-09-04T16:46:07-07:00","datePublished":"2018-09-04T16:46:07-07:00","mainEntityOfPage":{"@type":"WebPage","@id":"http://localhost:4000/android/tutorial.html"},"@context":"http://schema.org"} @@ -151,7 +151,7 @@ -