diff --git a/_comments/comment1.md b/_comments/comment1.md index 30674f8..896dfd5 100644 --- a/_comments/comment1.md +++ b/_comments/comment1.md @@ -1,7 +1,7 @@ --- +slug: comment1 post: 2023-10-02-ask-the-saga-of-the-disappearing-ergonomic-chair-continues author: commenter1 date: 2023-10-02 12:00:00 +0000 -slug: comment1 --- Haha, this totally happened to me last year. We had a phantom chair thief at work and it became an ongoing office joke for months! diff --git a/_comments/comment1_reply1.md b/_comments/comment1_reply1.md index abc6f14..1ca72d3 100644 --- a/_comments/comment1_reply1.md +++ b/_comments/comment1_reply1.md @@ -1,8 +1,8 @@ --- +slug: comment1_reply1 +parent: comment1 post: 2023-10-02-ask-the-saga-of-the-disappearing-ergonomic-chair-continues author: nestedcommenter1 date: 2023-10-02 13:00:00 +0000 -parent: comment1 -slug: comment1_reply1 --- Did they ever catch who it was? 😂 I'd totally set up a hidden camera if it kept happening that much. diff --git a/_comments/comment2.md b/_comments/comment2.md index 7a42c75..5b84ffb 100644 --- a/_comments/comment2.md +++ b/_comments/comment2.md @@ -1,7 +1,7 @@ --- +slug: comment2 post: 2023-10-02-ask-the-saga-of-the-disappearing-ergonomic-chair-continues author: commenter2 date: 2023-10-02 14:00:00 +0000 -slug: comment2 --- At my old job, chairs were so bad people would "borrow" a good one whenever someone went on vacation. A real survival of the fittest situation! diff --git a/_includes/comment.liquid b/_includes/comment.liquid index 40cc33a..fb52757 100644 --- a/_includes/comment.liquid +++ b/_includes/comment.liquid @@ -1,26 +1,42 @@ {% comment %} - Comment template - displays a single comment and its nested replies + Flat iterative version - no recursion, just nested loops up to N levels {% endcomment %} -
{{ 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 #} +