78 lines
3.8 KiB
Plaintext
78 lines
3.8 KiB
Plaintext
{% comment %}
|
||
Supports up to 6 levels of nested comments (non-recursive)
|
||
{% endcomment %}
|
||
|
||
{% assign top_comments = site.comments | where: "parent", nil | sort: "date" %}
|
||
|
||
{% for comment in top_comments %}
|
||
<div class="px-0 text-sm border-l-2 border-gray-300 pl-2 mb-4">
|
||
<div class="mb-1">
|
||
<a href="#" class="text-text-muted no-underline text-sm hover:text-link-hover">▲</a>
|
||
<small class="text-text-muted ml-2">@{{ comment.author }}</small>
|
||
<small class="text-text-muted ml-2">{{ comment.date | date: "%b %d, %Y" }}</small>
|
||
</div>
|
||
<p>{{ comment.content }}</p>
|
||
<small class="text-right underline text-xs cursor-pointer mt-1 inline-block">reply</small>
|
||
|
||
{% assign replies1 = site.comments | where: "parent", comment.slug | sort: "date" %}
|
||
{% for reply1 in replies1 %}
|
||
<div class="ml-4 mt-3 border-l-2 border-gray-200 pl-2">
|
||
<div class="mb-1">
|
||
<small class="text-text-muted">@{{ reply1.author }}</small> –
|
||
<small class="text-text-muted">{{ reply1.date | date: "%b %d, %Y" }}</small>
|
||
</div>
|
||
<p>{{ reply1.content }}</p>
|
||
<small class="text-right underline text-xs cursor-pointer mt-1 inline-block">reply</small>
|
||
|
||
{% assign replies2 = site.comments | where: "parent", reply1.slug | sort: "date" %}
|
||
{% for reply2 in replies2 %}
|
||
<div class="ml-4 mt-3 border-l-2 border-gray-200 pl-2">
|
||
<div class="mb-1">
|
||
<small class="text-text-muted">@{{ reply2.author }}</small> –
|
||
<small class="text-text-muted">{{ reply2.date | date: "%b %d, %Y" }}</small>
|
||
</div>
|
||
<p>{{ reply2.content }}</p>
|
||
<small class="text-right underline text-xs cursor-pointer mt-1 inline-block">reply</small>
|
||
|
||
{% assign replies3 = site.comments | where: "parent", reply2.slug | sort: "date" %}
|
||
{% for reply3 in replies3 %}
|
||
<div class="ml-4 mt-3 border-l-2 border-gray-200 pl-2">
|
||
<div class="mb-1">
|
||
<small class="text-text-muted">@{{ reply3.author }}</small> –
|
||
<small class="text-text-muted">{{ reply3.date | date: "%b %d, %Y" }}</small>
|
||
</div>
|
||
<p>{{ reply3.content }}</p>
|
||
<small class="text-right underline text-xs cursor-pointer mt-1 inline-block">reply</small>
|
||
|
||
{% assign replies4 = site.comments | where: "parent", reply3.slug | sort: "date" %}
|
||
{% for reply4 in replies4 %}
|
||
<div class="ml-4 mt-3 border-l-2 border-gray-200 pl-2">
|
||
<div class="mb-1">
|
||
<small class="text-text-muted">@{{ reply4.author }}</small> –
|
||
<small class="text-text-muted">{{ reply4.date | date: "%b %d, %Y" }}</small>
|
||
</div>
|
||
<p>{{ reply4.content }}</p>
|
||
<small class="text-right underline text-xs cursor-pointer mt-1 inline-block">reply</small>
|
||
|
||
{% assign replies5 = site.comments | where: "parent", reply4.slug | sort: "date" %}
|
||
{% for reply5 in replies5 %}
|
||
<div class="ml-4 mt-3 border-l-2 border-gray-200 pl-2">
|
||
<div class="mb-1">
|
||
<small class="text-text-muted">@{{ reply5.author }}</small> –
|
||
<small class="text-text-muted">{{ reply5.date | date: "%b %d, %Y" }}</small>
|
||
</div>
|
||
<p>{{ reply5.content }}</p>
|
||
<small class="text-right underline text-xs cursor-pointer mt-1 inline-block">reply</small>
|
||
</div>
|
||
{% endfor %}
|
||
</div>
|
||
{% endfor %}
|
||
</div>
|
||
{% endfor %}
|
||
</div>
|
||
{% endfor %}
|
||
</div>
|
||
{% endfor %}
|
||
</div>
|
||
{% endfor %}
|