From 7628ff96a9c4eeb130906a569298a066e5bc5eec Mon Sep 17 00:00:00 2001 From: Kerby Martino Date: Tue, 29 Apr 2025 09:13:52 +0800 Subject: [PATCH] Add comment support and redesign post layout Introduced a new nested comment system for posts, along with related configuration updates. Enhanced the post layout to include an improved structure, metadata, and a voting mechanism for better user interaction. --- _comments/comment1.md | 6 ++ _comments/comment1_reply1.md | 7 +++ _comments/comment2.md | 6 ++ _comments/comment3.md | 6 ++ _comments/comment4.md | 6 ++ _comments/comment4_reply1.md | 7 +++ _comments/comment4_reply1_reply1.md | 7 +++ _comments/comment4_reply1_reply1_reply1.md | 7 +++ .../comment4_reply1_reply1_reply1_reply1.md | 7 +++ ...ent4_reply1_reply1_reply1_reply1_reply1.md | 7 +++ ...ply1_reply1_reply1_reply1_reply1_reply1.md | 7 +++ _config.yml | 5 +- _layouts/post.liquid | 61 ++++++++++++++++--- pages/single-post.md | 9 +++ 14 files changed, 139 insertions(+), 9 deletions(-) create mode 100644 _comments/comment1.md create mode 100644 _comments/comment1_reply1.md create mode 100644 _comments/comment2.md create mode 100644 _comments/comment3.md create mode 100644 _comments/comment4.md create mode 100644 _comments/comment4_reply1.md create mode 100644 _comments/comment4_reply1_reply1.md create mode 100644 _comments/comment4_reply1_reply1_reply1.md create mode 100644 _comments/comment4_reply1_reply1_reply1_reply1.md create mode 100644 _comments/comment4_reply1_reply1_reply1_reply1_reply1.md create mode 100644 _comments/comment4_reply1_reply1_reply1_reply1_reply1_reply1.md create mode 100644 pages/single-post.md diff --git a/_comments/comment1.md b/_comments/comment1.md new file mode 100644 index 0000000..b35cee6 --- /dev/null +++ b/_comments/comment1.md @@ -0,0 +1,6 @@ +--- +post: 2023-10-02-ask-the-saga-of-the-disappearing-ergonomic-chair-continues +author: commenter1 +date: 2023-10-02 08:00:00 +0000 +content: "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!" +--- \ No newline at end of file diff --git a/_comments/comment1_reply1.md b/_comments/comment1_reply1.md new file mode 100644 index 0000000..2f4a188 --- /dev/null +++ b/_comments/comment1_reply1.md @@ -0,0 +1,7 @@ +--- +post: 2023-10-02-ask-the-saga-of-the-disappearing-ergonomic-chair-continues +author: nestedcommenter1 +date: 2023-10-02 09:00:00 +0000 +parent: comment1 +content: "Did they ever catch who it was? 😂 I'd totally set up a hidden camera if it kept happening that much." +--- \ No newline at end of file diff --git a/_comments/comment2.md b/_comments/comment2.md new file mode 100644 index 0000000..230364b --- /dev/null +++ b/_comments/comment2.md @@ -0,0 +1,6 @@ +--- +post: 2023-10-02-ask-the-saga-of-the-disappearing-ergonomic-chair-continues +author: commenter2 +date: 2023-10-02 07:00:00 +0000 +content: "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!" +--- \ No newline at end of file diff --git a/_comments/comment3.md b/_comments/comment3.md new file mode 100644 index 0000000..09f1458 --- /dev/null +++ b/_comments/comment3.md @@ -0,0 +1,6 @@ +--- +post: 2023-10-02-ask-the-saga-of-the-disappearing-ergonomic-chair-continues +author: commenter3 +date: 2023-10-02 05:00:00 +0000 +content: "I recommend putting a bright sticker with your name on the chair. Makes it harder for people to pretend they didn't know it wasn't theirs." +--- \ No newline at end of file diff --git a/_comments/comment4.md b/_comments/comment4.md new file mode 100644 index 0000000..1f3e9b1 --- /dev/null +++ b/_comments/comment4.md @@ -0,0 +1,6 @@ +--- +post: 2023-10-02-ask-the-saga-of-the-disappearing-ergonomic-chair-continues +author: commenter1 +date: 2023-10-02 08:00:00 +0000 +content: "Haha, this totally happened to me last year. It was hilarious and annoying at the same time." +--- \ No newline at end of file diff --git a/_comments/comment4_reply1.md b/_comments/comment4_reply1.md new file mode 100644 index 0000000..919eb89 --- /dev/null +++ b/_comments/comment4_reply1.md @@ -0,0 +1,7 @@ +--- +post: 2023-10-02-ask-the-saga-of-the-disappearing-ergonomic-chair-continues +author: nested1 +date: 2023-10-02 08:10:00 +0000 +parent: comment4 +content: "Honestly, office pranks can either build great vibes or cause chaos if not handled well 😂" +--- \ No newline at end of file diff --git a/_comments/comment4_reply1_reply1.md b/_comments/comment4_reply1_reply1.md new file mode 100644 index 0000000..699ac43 --- /dev/null +++ b/_comments/comment4_reply1_reply1.md @@ -0,0 +1,7 @@ +--- +post: 2023-10-02-ask-the-saga-of-the-disappearing-ergonomic-chair-continues +author: nested2 +date: 2023-10-02 08:20:00 +0000 +parent: comment4_reply1 +content: "Yeah, in our team it turned into an inside joke that lasted months. No HR complaints thankfully!" +--- \ No newline at end of file diff --git a/_comments/comment4_reply1_reply1_reply1.md b/_comments/comment4_reply1_reply1_reply1.md new file mode 100644 index 0000000..7fefbfd --- /dev/null +++ b/_comments/comment4_reply1_reply1_reply1.md @@ -0,0 +1,7 @@ +--- +post: 2023-10-02-ask-the-saga-of-the-disappearing-ergonomic-chair-continues +author: nested3 +date: 2023-10-02 08:30:00 +0000 +parent: comment4_reply1_reply1 +content: "Ours got so bad management had to install chair locks (yes, seriously!)." +--- \ No newline at end of file diff --git a/_comments/comment4_reply1_reply1_reply1_reply1.md b/_comments/comment4_reply1_reply1_reply1_reply1.md new file mode 100644 index 0000000..5842e98 --- /dev/null +++ b/_comments/comment4_reply1_reply1_reply1_reply1.md @@ -0,0 +1,7 @@ +--- +post: 2023-10-02-ask-the-saga-of-the-disappearing-ergonomic-chair-continues +author: nested4 +date: 2023-10-02 08:40:00 +0000 +parent: comment4_reply1_reply1_reply1 +content: "😂 Chair locks?! That's next level commitment to stopping thefts." +--- \ No newline at end of file diff --git a/_comments/comment4_reply1_reply1_reply1_reply1_reply1.md b/_comments/comment4_reply1_reply1_reply1_reply1_reply1.md new file mode 100644 index 0000000..bc49a4f --- /dev/null +++ b/_comments/comment4_reply1_reply1_reply1_reply1_reply1.md @@ -0,0 +1,7 @@ +--- +post: 2023-10-02-ask-the-saga-of-the-disappearing-ergonomic-chair-continues +author: nested5 +date: 2023-10-02 08:50:00 +0000 +parent: comment4_reply1_reply1_reply1_reply1 +content: "I would LOVE to see the memo that went out announcing chair locks to employees 😆" +--- \ No newline at end of file diff --git a/_comments/comment4_reply1_reply1_reply1_reply1_reply1_reply1.md b/_comments/comment4_reply1_reply1_reply1_reply1_reply1_reply1.md new file mode 100644 index 0000000..35e7c2c --- /dev/null +++ b/_comments/comment4_reply1_reply1_reply1_reply1_reply1_reply1.md @@ -0,0 +1,7 @@ +--- +post: 2023-10-02-ask-the-saga-of-the-disappearing-ergonomic-chair-continues +author: nested6 +date: 2023-10-02 08:55:00 +0000 +parent: comment4_reply1_reply1_reply1_reply1_reply1 +content: "Imagine coming into work one day and finding your chair padlocked to the floor 😅" +--- \ No newline at end of file diff --git a/_config.yml b/_config.yml index b48520c..6284203 100644 --- a/_config.yml +++ b/_config.yml @@ -50,4 +50,7 @@ pagination: collections: posts: output: true - permalink: /:collection/:title/ \ No newline at end of file + permalink: /:collection/:title/ + comments: + output: false + permalink: /:collection/:title/ diff --git a/_layouts/post.liquid b/_layouts/post.liquid index 13163ef..27a1ef2 100644 --- a/_layouts/post.liquid +++ b/_layouts/post.liquid @@ -1,12 +1,57 @@ --- layout: default --- -
-
-

{{ page.title }}

- -
-
- {{ content }} -
+
+
+ ▲ +
+
+
+

+ {{ page.title }} +

+ + +
+ @{{ page.author }} + {% assign comment_count = site.comments | where: "post", page.slug | size %} + {% if comment_count == 0 %} + {% assign filename = page.path | split: "/" | last | replace: ".md", "" %} + {% assign comment_count = site.comments | where: "post", filename | size %} + {% endif %} + {{ page.date | date: "%B %d, %Y" }} | report | next | {{ comment_count }} comments +
+ +
+ {{ content }} +
+
+
+ +
+
+
+ +
+ +
+
+
+ +
+
+ +

Comments

+ +
+ {% assign comments = site.comments | where: "post", page.slug | where_exp: "item", "item.parent == nil" %} + {% if comments.size == 0 %} + {% assign filename = page.path | split: "/" | last | replace: ".md", "" %} + {% assign comments = site.comments | where: "post", filename | where_exp: "item", "item.parent == nil" %} + {% endif %} + {% for comment in comments %} + {% include comment.liquid comment=comment level=0 %} + {% endfor %} +
+
diff --git a/pages/single-post.md b/pages/single-post.md new file mode 100644 index 0000000..fb76ba9 --- /dev/null +++ b/pages/single-post.md @@ -0,0 +1,9 @@ +--- +layout: post +title: "[Ask] The saga of the disappearing ergonomic chair continues. ✏️" +permalink: /posts/ask-the-saga-of-the-disappearing-ergonomic-chair-continues/ +author: deskdetective +date: 2023-10-02 10:00:00 +0000 +slug: 2023-10-02-ask-the-saga-of-the-disappearing-ergonomic-chair-continues +--- +Every time I leave my desk, it seems to vanish. Suspecting foul play at this point. Anyone else faced something like this? \ No newline at end of file