{% comment %} Flat iterative version - no recursion, just nested loops up to N levels {% endcomment %} {% assign top_comments = site.comments | where: "parent", nil | sort: "date" %} {% for comment in top_comments %}
{{ comment.content }}
reply {% assign replies = site.comments | where: "parent", comment.slug | sort: "date" %} {% for reply in replies %}{{ reply.content }}
reply {% assign replies2 = site.comments | where: "parent", reply.slug | sort: "date" %} {% for reply2 in replies2 %}{{ reply2.content }}
reply {# Extend further levels here if needed #}