diff --git a/_includes/mobile_comment.liquid b/_includes/mobile_comment.liquid index a34dd95..b0edffd 100644 --- a/_includes/mobile_comment.liquid +++ b/_includes/mobile_comment.liquid @@ -1,8 +1,41 @@ {% comment %} - Supports up to 6 le + 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 top_comments = site.comments | where: "parent", nil | sort: "date" %} +{% assign top_level_comments = site.comments | where: "post", page.slug | where_exp: "item", "item.parent == nil" | sort: "date" %} -{% for comment in top_comments %} -{% endfor %} \ No newline at end of file +
+ {% 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" }} + +
+

{{ comment.content }}

+ +
+ {% endfor %} + {% else %} +

No comments yet.

+ {% endif %} +
+ +{% comment %} + Placeholder for where JavaScript would load the replies for a selected comment. + Example structure for a reply view (to be managed by JS): + + +{% endcomment %}