add utterances

This commit is contained in:
Sandro Stikić 2024-07-20 11:06:11 +08:00
parent c620187811
commit a5b96f006f
No known key found for this signature in database
9 changed files with 93 additions and 14 deletions

View file

@ -108,3 +108,18 @@
</span>
{% endif -%}
{% endmacro tags %}
{% macro comments(page) %}
{%- if config.extra.utterances.enabled and page.relative_path is not starting_with("pages/") %}
<div class="comments">
<div class="comments__title">
<span class="comments__title-h">comments</span>
<hr />
</div>
<script src="https://utteranc.es/client.js" repo="{{ config.extra.utterances.repo }}"
issue-term="{{ config.extra.utterances.post_map }}" label="{{ config.extra.utterances.label }}"
theme="{{ config.extra.utterances.theme }}" crossorigin="anonymous" async></script>
</div>
{% endif -%}
{% endmacro comments %}

View file

@ -8,6 +8,7 @@
<div class="post">
{{ post_macros::header(page=page) }}
{{ post_macros::content(page=page, summary=false, show_only_description=false) }}
{{ post_macros::comments(page=page) }}
{{ post_macros::earlier_later(page=page) }}
</div>
{% endblock content %}