feat: add support for Hyvor Talk comments

This commit is contained in:
welpo
2023-07-17 20:10:18 +02:00
parent 5214dd3560
commit 7924e8206c
10 changed files with 184 additions and 43 deletions

View File

@@ -83,14 +83,17 @@
{# Check if comments are enabled #}
{% set giscus_enabled = config.extra.giscus.enabled_for_all_posts or page.extra.giscus %}
{% set utterances_enabled = config.extra.utterances.enabled_for_all_posts or page.extra.utterances %}
{% set hyvortalk_enabled = config.extra.hyvortalk.enabled_for_all_posts or page.extra.hyvortalk %}
{# Ensure only one comment system is enabled #}
{% if giscus_enabled and utterances_enabled %}
{% if giscus_enabled and utterances_enabled or giscus_enabled and hyvortalk_enabled or utterances_enabled and hyvortalk_enabled %}
{{ throw(message="ERROR: Multiple comment systems have been enabled for the same page. Check your config.toml and individual page settings to ensure only one comment system is activated at a time.") }}
{% elif giscus_enabled %}
{% set comment_system = "giscus" %}
{% elif utterances_enabled %}
{% set comment_system = "utterances" %}
{% elif hyvortalk_enabled %}
{% set comment_system = "hyvortalk" %}
{% endif %}
{% if comment_system %}