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.
This commit is contained in:
Kerby Martino committed 2025-04-29 09:13:52 +08:00
1 parent 4cf7cc1a49
commit 7628ff96a9
14 files changed
+135 -5

No files matched your search

+6
View File
@@ -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!"
---
+7
View File
@@ -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."
---
+6
View File
@@ -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!"
---
+6
View File
@@ -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."
---
+6
View File
@@ -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."
---
+7
View File
@@ -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 😂"
---
+7
View File
@@ -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!"
---
@@ -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!)."
---
@@ -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."
---
@@ -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 😆"
---
@@ -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 😅"
---
+3
View File
@@ -51,3 +51,6 @@ collections:
posts:
output: true
permalink: /:collection/:title/
comments:
output: false
permalink: /:collection/:title/
+50 -5
View File
@@ -1,12 +1,57 @@
---
layout: default
---
<article class="post">
<header class="post-header">
<h1 class="post-title">{{ page.title }}</h1>
<p class="post-meta">{{ page.date | date: "%B %d, %Y" }}</p>
</header>
<article class="flex">
<div class="mr-2">
<a href="#" class="text-text-muted no-underline text-sm leading-none inline-block pt-0.5 hover:text-link-hover" title="Upvote">▲</a>
</div>
<div class="flex-1 text-left">
<div>
<p>
<strong><a href="#" class="text-text-title font-normal text-base hover:underline">{{ page.title }}</a></strong>
</p>
<!-- Post title header -->
<div class="mt-0.5 mb-2 text-sm flex items-center">
<small class="text-text-muted ml-2 text-sm hover:underline">@{{ page.author }}</small>
{% 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 %}
<small class="text-text-muted ml-2 text-sm">{{ page.date | date: "%B %d, %Y" }} | <a href="#" class="ml-2 text-xs text-primary hover:underline">report</a> | <a href="#" class="ml-2 text-xs text-primary hover:underline">next</a> | <a href="#" class="ml-2 text-xs text-primary hover:underline">{{ comment_count }} comments</a></small>
</div>
<div class="post-content">
{{ content }}
</div>
</div>
</div>
</article>
<div class="mt-8">
<form>
<div class="mb-4">
<label class="block font-medium text-sm mb-1" for="comment-body">Comment:</label>
<div>
<textarea class="w-full px-3 py-2 bg-bg-light border border-gray-300 rounded" id="comment-body" name="body" placeholder="Enter your comment" required></textarea>
</div>
</div>
<div>
<button class="px-4 py-2 bg-primary text-white rounded hover:bg-primary-dark" type="submit">Add Comment</button>
</div>
</form>
<h3 class="mt-4 text-lg font-medium">Comments</h3>
<div class="mt-4">
{% 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 %}
</div>
</div>
+9
View File
@@ -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?