From cf1499e0eca5307fae3e7573854a72e4493e9c53 Mon Sep 17 00:00:00 2001 From: "Kerby Martino (aider)" Date: Fri, 2 May 2025 12:05:53 +0800 Subject: [PATCH] fix: Debug mobile comments and improve reply handling --- _includes/mobile_comment.liquid | 35 ++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/_includes/mobile_comment.liquid b/_includes/mobile_comment.liquid index b0edffd..372c3af 100644 --- a/_includes/mobile_comment.liquid +++ b/_includes/mobile_comment.liquid @@ -3,24 +3,38 @@ Assumes JavaScript will handle the navigation to nested replies using fragment identifiers. {% endcomment %} -{% assign top_level_comments = site.comments | where: "post", page.slug | where_exp: "item", "item.parent == nil" | sort: "date" %} + + + +{% assign post_comments = site.comments | where: "post", page.slug %} + + +{% assign top_level_comments = post_comments | where_exp: "item", "item.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 %} -
+ +
{# Changed ID prefix for clarity #}
@{{ comment.author }} {{ comment.date | date: "%b %d, %Y" }}
-

{{ comment.content }}

+

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

{# Added default filter #}
{% endfor %} @@ -31,11 +45,14 @@ {% comment %} Placeholder for where JavaScript would load the replies for a selected comment. - Example structure for a reply view (to be managed by JS): + This container could be populated by JS when a 'View Replies' link is clicked. +{% endcomment %} -