This repository has been archived on 2023-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
website/_includes/post.njk
Sofía Aritz 8876c53ecb Implement comments
Based on https://berglyd.net/blog/2023/03/mastodon-comments/

Scripts are loaded only on blog posts. DOMPurify comes from the 0.3.1 release (dist/ on their GitHub repo)
2023-03-17 00:41:51 +01:00

27 lines
690 B
Plaintext

---
layout: simple_page.njk
load_comments_script: true
---
<h1>{{ title }}</h1>
{% if date %}
<time datetime="{{ date | htmlDateString }}">{{ date | readableDate }}</time> |
{% endif %}
{% if tags %}
{% for tag in tags %}
<span>{{ tag }} {% if loop.last == false %}·{% endif %}</span>
{% endfor %}
|
{% endif %}
{{ content | timeToRead }}
{{ content | safe }}
{% if comment_status %}
<hr>
<h3>comentarios · <a href="https://hachyderm.io/@sofiaritz/{{ comment_status }}">ver en el servidor</a></h3>
<button data-status="{{ comment_status }}" id="comment-load-btn">Cargar comentarios</button>
<section id="comment-section"></section>
{% endif %}