From 838f410b4d883e43aeb88aa70bfdca5d658cf12e Mon Sep 17 00:00:00 2001 From: "Kerby Martino (aider)" Date: Tue, 29 Apr 2025 09:34:00 +0800 Subject: [PATCH] fix: ensure comments are rendered correctly --- _layouts/post.liquid | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/_layouts/post.liquid b/_layouts/post.liquid index 27a1ef2..7dd37e9 100644 --- a/_layouts/post.liquid +++ b/_layouts/post.liquid @@ -50,8 +50,12 @@ layout: default {% assign filename = page.path | split: "/" | last | replace: ".md", "" %} {% assign comments = site.comments | where: "post", filename | where_exp: "item", "item.parent == nil" %} {% endif %} - {% for comment in comments %} - {% include comment.liquid comment=comment level=0 %} - {% endfor %} + {% if comments.size > 0 %} + {% for comment in comments %} + {% include comment.liquid comment=comment level=0 %} + {% endfor %} + {% else %} +

No comments yet.

+ {% endif %}