{% capture default_slug %}{{ page.slug | default: (page.title | slugify) }}{% endcapture %} {% capture slug %}{{ (page.slug | fallback: default_slug) | downcase | replace: '.', '-' }}{% endcapture %} {% assign comments_map = site.data.comments %} {% assign comments = site.emptyArray %} {% for comment in comments_map %}
{% assign comments = comments | push: comment[1] %}
{% endfor %} {% assign comment_count = comments | size %} {% assign author = site.authors %} <div id=“comments”>
<h2>Deixe seu comentário</h2> {% include new-comment.html %} <h3 id="comment-count">{% if comment_count == 1 %}Um comentário{% else %}{{ comment_count }} comentários{% endif %}</h3> <ol id="comments-list"> {% assign sorted_comments = comments | sort: 'date' %} {% for comment in sorted_comments %} <li{% if comment.name == author.name %} class="byauthor" {% endif %}> {% include comment.html %} </li> {% endfor %} </ol>
</div>