diff --git a/_includes/mobile_comment.liquid b/_includes/mobile_comment.liquid index c7ab18b..0c851f6 100644 --- a/_includes/mobile_comment.liquid +++ b/_includes/mobile_comment.liquid @@ -1,48 +1,8 @@ {% comment %} Mobile Comment View: Renders a flat list of top-level comments for the current post. - Assumes JavaScript will handle the navigation to nested replies using fragment identifiers. {% endcomment %} -{% assign post_comments = site.comments | where: "post", page.slug %} -{% assign top_level_comments = post_comments | where_exp: "item", "item.parent == nil or item.parent == ''" | sort: "date" %} +{% assign top_comments = site.comments | where: "parent", nil | sort: "date" %} -
- {% if top_level_comments.size > 0 %} - {% for comment in top_level_comments %} - {% assign direct_replies = site.comments | where: "parent", comment.slug %} -
-
- - @{{ comment.author }} - {{ comment.date | date: "%b %d, %Y" }} | parent | next | [-] -
-

{{ comment.content | default: "Missing content" }}

{# Added default filter #} -
- {% if direct_replies.size > 0 %} - {# Use data attribute for JS #} - View Replies ({{ direct_replies.size }}) - - {% else %} - No Replies - {% endif %} -
-
- {% endfor %} - {% else %} -

No comments yet.

- {% endif %} -
- -{% comment %} - Placeholder for where JavaScript would load the replies for a selected comment. - This container could be populated by JS when a 'View Replies' link is clicked. -{% endcomment %} - - +{% for comment in top_comments %} +{% endfor %} \ No newline at end of file