From 4f78eee1f38226e281ffa9a7e6233cf5aa2c288b Mon Sep 17 00:00:00 2001 From: Kerby Martino Date: Sun, 4 May 2025 16:53:20 +0800 Subject: [PATCH] feat: Add user comments section with upvotes and replies --- _includes/user_comments.liquid | 31 +++++++++++++++++++++++++++++++ pages/user_comments.md | 8 ++++++++ 2 files changed, 39 insertions(+) create mode 100644 _includes/user_comments.liquid create mode 100644 pages/user_comments.md diff --git a/_includes/user_comments.liquid b/_includes/user_comments.liquid new file mode 100644 index 0000000..6c75ee0 --- /dev/null +++ b/_includes/user_comments.liquid @@ -0,0 +1,31 @@ +

{{ page.author }}'s comments

+ +{% assign top_comments = site.comments | where: "parent", nil | sort: "date" %} + +
+
+ {% for comment in top_comments %} +
+

{{ comment.content }} +

+
+
+ + {{ comment.upvotes }} + + + REPLY + + + {{ comment.replies }} + +
+ + {{ comment.author }} + {{ comment.date | date: "%d %b %Y" }} + +
+
+ {% endfor %} +
+
diff --git a/pages/user_comments.md b/pages/user_comments.md new file mode 100644 index 0000000..80a6038 --- /dev/null +++ b/pages/user_comments.md @@ -0,0 +1,8 @@ +--- +layout: simple +title: User Comments +author: commenter1 +permalink: /user_comments/ +--- + +{% include user_comments.liquid %} \ No newline at end of file