diff --git a/_includes/comments.html b/_includes/comments.html index 4ff59e27..b27c893b 100644 --- a/_includes/comments.html +++ b/_includes/comments.html @@ -17,14 +17,23 @@
{{ site.data.ui-text[site.locale].comments_title | default: "Comments" }}
- {% assign comments = site.data.comments[page.slug] | sort %} + {% assign comments = site.data.comments[page.slug] %} + + + {% assign commentObjects = '' | split: '' %} + {% for comment in comments %} + {% assign commentObject = comment[1] %} + {% assign commentObjects = commentObjects | push: commentObject %} + {% endfor %} + {% assign comments = commentObjects | sort: "date" %} {% for comment in comments %} - {% 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 %} + {% assign email = comment.email %} + {% assign name = comment.name %} + {% assign url = comment.url %} + {% assign date = comment.date %} + {% assign message = comment.message %} {% include comment.html index=forloop.index email=email name=name url=url date=date message=message %} {% endfor %} {% endif %} @@ -91,14 +100,23 @@{{ site.data.ui-text[site.locale].comments_title | default: "Comments" }}
- {% assign comments = site.data.comments[page.slug] | sort %} + {% assign comments = site.data.comments[page.slug] %} + + + {% assign commentObjects = '' | split: '' %} + {% for comment in comments %} + {% assign commentObject = comment[1] %} + {% assign commentObjects = commentObjects | push: commentObject %} + {% endfor %} + {% assign comments = commentObjects | sort: "date" %} {% for comment in comments %} - {% 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 %} + {% assign email = comment.email %} + {% assign name = comment.name %} + {% assign url = comment.url %} + {% assign date = comment.date %} + {% assign message = comment.message %} {% include comment.html index=forloop.index email=email name=name url=url date=date message=message %} {% endfor %} {% endif %}