From d0542271a07be0b6d324b7be49272e7eeae253e9 Mon Sep 17 00:00:00 2001 From: Lewis Dale Date: Fri, 5 Jan 2024 13:48:15 +0000 Subject: [PATCH] Nested replies --- src/_includes/components/reply.njk | 13 +++++++++++++ src/_includes/note.njk | 24 ++++++++---------------- 2 files changed, 21 insertions(+), 16 deletions(-) create mode 100644 src/_includes/components/reply.njk diff --git a/src/_includes/components/reply.njk b/src/_includes/components/reply.njk new file mode 100644 index 0000000..c9928c6 --- /dev/null +++ b/src/_includes/components/reply.njk @@ -0,0 +1,13 @@ +{% macro reply(note) %} +
+ + {{ note.text | md | safe }} + {% if note.replies.length %} + + {% endif %} +
+{% endmacro %} \ No newline at end of file diff --git a/src/_includes/note.njk b/src/_includes/note.njk index 407a7b2..29d4d16 100644 --- a/src/_includes/note.njk +++ b/src/_includes/note.njk @@ -1,6 +1,7 @@ --- layout: "base.njk" --- +{% import "components/reply.njk" as replyMacros %}
@@ -11,23 +12,14 @@ layout: "base.njk" {{ content | safe }} -
{{ note.replies | dump }}
- -
\ No newline at end of file