From c1821a8eb8d74907c2ff9de87c7382ff53c8ed58 Mon Sep 17 00:00:00 2001 From: Kerby Martino Date: Tue, 29 Apr 2025 11:05:21 +0800 Subject: [PATCH] refactor: update comment replies logic to use slug instead of filename --- _includes/comment.liquid | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/_includes/comment.liquid b/_includes/comment.liquid index faf313f..b32aeb8 100644 --- a/_includes/comment.liquid +++ b/_includes/comment.liquid @@ -13,15 +13,14 @@ reply - {% comment %} - Find and render any replies to this comment - We need to get the filename without extension to match the parent field - {% endcomment %} - {% assign comment_filename = comment.path | split: "/" | last | replace: ".md", "" %} - {% assign replies = site.comments | where: "parent", comment_filename | sort: "date" %} + {% assign replies = site.comments | where: "parent", comment.slug | sort: "date" %} +
comment_slug: {{ comment.slug }}
{% for reply in replies %} +
parent: {{ reply.parent }}
+
slug: {{ reply.slug }}
+ {% include comment.liquid comment=reply %}
{% endfor %}