feat: Add user comments section with upvotes and replies
This commit is contained in:
1 parent
846f6eadd5
commit
4f78eee1f3
2 files changed
+39
No files matched your search
@@ -0,0 +1,31 @@
|
||||
<h3 class="mt-4 text-lg font-medium">{{ page.author }}'s comments</h3>
|
||||
|
||||
{% assign top_comments = site.comments | where: "parent", nil | sort: "date" %}
|
||||
|
||||
<div class="mt-4">
|
||||
<div id="mobile-comments-list" class="space-y-4">
|
||||
{% for comment in top_comments %}
|
||||
<div class="border-b border-gray-200 pb-3 mb-3" id="mobile-comment-comment1">
|
||||
<p class="text-sm mb-2">{{ comment.content }}
|
||||
</p>
|
||||
<div class="mt-2 mb-1 text-sm flex flex-col md:flex-row items-start md:items-center md:space-x-2">
|
||||
<div class="flex items-start space-x-2 mb-2 md:mb-0">
|
||||
<span class="bg-gray-200 text-gray-700 text-xs font-action px-4 py-2 rounded-full flex items-center cursor-pointer hover:bg-link-hover">
|
||||
<i class="fa-solid fa-arrow-up mr-1"></i> {{ comment.upvotes }}
|
||||
</span>
|
||||
<span class="bg-gray-200 text-gray-700 text-xs font-action px-4 py-2 rounded-full flex items-center cursor-pointer hover:bg-link-hover">
|
||||
<i class="fas fa-reply mr-1"></i> REPLY
|
||||
</span>
|
||||
<a href="/comments/{{ comment.slug }}" class="bg-gray-200 text-gray-700 text-xs font-action px-4 py-2 rounded-full flex items-center cursor-pointer hover:bg-link-hover">
|
||||
<i class="fas fa-comment mr-1"></i> {{ comment.replies }}
|
||||
</a>
|
||||
</div>
|
||||
<small class="text-sm font-action">
|
||||
<a href="#" class="text-sm hover:underline">{{ comment.author }}</a>
|
||||
<span class="text-text-muted text-sm opacity-75">{{ comment.date | date: "%d %b %Y" }}</span>
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
layout: simple
|
||||
title: User Comments
|
||||
author: commenter1
|
||||
permalink: /user_comments/
|
||||
---
|
||||
|
||||
{% include user_comments.liquid %}
|
||||
Reference in new issue
Block a user