Permalink
Fetching contributors…
Cannot retrieve contributors at this time
28 lines (26 sloc) 1.27 KB
{% if site.repository and site.staticman.branch %}
{% 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].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 %}
</div>
{% endif %}
{% include comment-form.html %}
{% endif %}