<section class=“comments” id=“comment-section”>

{% if site.data.comments[page.slug] %}
<!-- Existing comments -->
<div class="comments__existing">
    <h4 class="title is-4">Comments</h4>
    {% assign comments = site.data.comments[page.slug] | where_exp: "item", "item.replying_to_uid == ''" %}

    {% assign comments_by_date = comments | sort: 'date' | reverse %}
    <!-- List main comments in reverse date order, newest first. List replies in date order, oldest first. -->
    {% for comment in comments_by_date %}
    {%- assign email = comment.email %}
    {%- assign name = comment.name %}
    {%- assign url = comment.url %}
    {%- assign date = comment.date %}
    {%- assign message = comment.message %}
    {%- assign uid = comment._id %}
    {% include themes/jmblog-theme/components/comment.html is_reply=false uid=uid replying_to=0 email=email name=name url=url date=date
    message=message uid=uid %}
    {% endfor %}
</div>
{% endif %}

{% unless page.comments == "closed" %}
<!-- New comment form -->
<div id="respond" class="comment__new">
    {% capture first_comment %}{% if comments.size < 1 %}true{% else %}false{% endif %}{% endcapture %}
    {% include themes/jmblog-theme/components/comment_form.html first_comment=first_comment %}
</div>
{% endunless %}

</section>

<script async defer src=“www.google.com/recaptcha/api.js” ></script>

{%- comment %} <script src=“ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js”>> {% endcomment -%} {%- comment %} <script src=“{{ '/assets/main.js' | relative_url }}”></script> {% endcomment -%} {%- comment %} <script src=“www.google.com/recaptcha/api.js”>> {% endcomment -%}

{% comment %} github.com/travisdowns/travisdowns.github.io/tree/master/_includes travisdowns.github.io/blog/2020/02/05/now-with-comments.html#fnref:v3 {% endcomment %}