Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (24 sloc) 1.13 KB
{% if site.data.comments[page.slug] %}
<div id="comments" class="page__comments js-comments">
<h2 class="title">
{% if site.data.comments[page.slug].size <= 1 %}
{{ site.data.comments[page.slug] | size | append: ' comment' }}
{% elsif site.data.comments[page.slug].size > 1 %}
{{ site.data.comments[page.slug] | size | append: ' comments' }}
{% endif %}
</h2>
{% assign comments = site.data.comments[page.slug] | sort | where_exp: 'comment', 'comment[1]._parent == comment[1]._id' %}
{% for comment in comments %}
{% assign id = comment[1]._id %}
{% assign parent = comment[1]._parent %}
{% 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 id=id parent=parent avatar=avatar email=email name=name url=url date=date message=message %}
{% endfor %}
</div>
{% endif %}
{% include comment-form.html %}