feat: add support for giscus & utterances comments

This commit is contained in:
welpo
2023-07-12 18:44:28 +02:00
parent 93c8b577b8
commit 19d120019b
17 changed files with 333 additions and 99 deletions

View File

@@ -80,26 +80,9 @@
{{ page.content | safe }}
</section>
{# Add comments if they are enabled #}
{{ macros_add_comments::add_comments() }}
</article>
{# giscus / utterances comments #}
{% if config.extra.giscus.enabled_for_all_posts or page.extra.giscus %}
{# TODO: HERE GOES GISCUS SUPPORT #}
{% elif config.extra.utterances.enabled_for_all_posts or page.extra.utterances %}
<div class="comments">
<script src="https://utteranc.es/client.js"
repo="{{ config.extra.utterances.repo }}"
issue-term="{{ config.extra.utterances.issue_term }}"
label="{{ config.extra.utterances.label }}"
theme="{{ config.extra.utterances.theme }}"
{%- if config.extra.utterances.lazy_loading -%}
data-loading="lazy"
{%- endif -%}
crossorigin="anonymous"
async>
</script>
</div>
{% endif %}
</main>
{% endmacro content %}