A full redesign of The Plain Libre Jekyll theme https://software.franco.net.eu.org/frnmst/the-flux-of-thought
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
the-flux-of-thought/_includes/comments.html

45 lines
1.8 KiB

<div>
{% capture mail %}{{ site.author.email }}{% endcapture %}
{% assign mail_substring = mail | split: '@' %}
{% assign mail_username = mail_substring[0] %}
{% assign mail_domain = mail_substring[1] %}
{% if page.is_post %}
{% capture mailto_subject %}{{ page.path | remove: ".md" | remove: "_posts/" | urlencode }}{% endcapture %}
{% else %}
{% capture mailto_subject %}{{ page.path | remove: ".html" | remove: ".md" | remove: "_pages/" | urlencode }}{% endcapture %}
{% endif %}
<div>
<h3>
<a href="mailto:{{ mail_username }}@{{ mail_domain }}?subject={{ mailto_subject }}">
Post a new comment</a>
</h3>
</div>
<div>
{% assign comment_counter = 0 %}
{% assign comments = site.comments | sort | reverse %}
{% for comment in comments %}
{% assign page_path = page.path | replace: "_posts/", "" | remove: ".md" %}
{% assign comment_fullpath = comment.path | replace: "_comments/", "" | split: "/" %}
{% assign comment_path = comment_fullpath[0] %}
{% assign comment_id = comment_fullpath[1] | remove: ".md" %}
{% if comment_path == page_path %}
{% assign parity_check = comment_counter | modulo: 2 %}
{% if parity_check == 0 %}
{% assign parity = "even" %}
{% else %}
{% assign parity = "odd" %}
{% endif %}
<a href="#comment-{{ comment_id }}" id="comment-{{ comment_id }}" class="{{ parity }}">
<div>
<div>Subject: {{ comment.subject }}</div>
<div>From: {{ comment.from }}</div>
<div>Arrived on: {{ comment.date | date: "%b %e %Y, %R %Z" }}</div>
{{ comment.content | markdownify }}
</div>
</a>
{% assign comment_counter = comment_counter | plus: 1 %}
{% endif %}
{% endfor %}
</div>
</div>