feat: add support for Isso comments

This commit is contained in:
welpo
2023-07-26 01:47:26 +02:00
parent e1dfd2ea07
commit 9a98789922
13 changed files with 561 additions and 31 deletions

View File

@@ -73,12 +73,15 @@
{%- if config.extra.allowed_domains -%}
;
{# Check if a comment system is enabled to allow the necessary domains and directives #}
{%- set utterances_enabled = config.extra.utterances.enabled_for_all_posts or page.extra.utterances -%}
{%- 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 giscus_enabled = config.extra.giscus.enabled_for_all_posts or page.extra.giscus %}
{% set hyvortalk_enabled = config.extra.hyvortalk.enabled_for_all_posts or page.extra.hyvortalk %}
{% set isso_enabled = config.extra.isso.enabled_for_all_posts or page.extra.isso %}
{% if hyvortalk_enabled %}
connect-src talk.hyvor.com;
{% elif isso_enabled %}
connect-src {{ config.extra.isso.endpoint_url }};
{% endif %}
{%- for domain in config.extra.allowed_domains -%}
@@ -95,6 +98,11 @@
{%- elif hyvortalk_enabled %} talk.hyvor.com
{%- endif %}
{%- endif -%}
{%- if domain.directive == "script-src" -%}
{%- if isso_enabled %} {{ config.extra.isso.endpoint_url }}
{%- endif %}
{%- endif -%}
{%- if not loop.last -%}
;
{%- endif -%}