{%- macro add_comments() -%} {% 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 %} {# Ensure only one comment system is enabled #} {% if giscus_enabled and utterances_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 %} {# Create a div to host giscus comments #}
{# giscus script to load the widget #} {% elif utterances_enabled %} {# Create a div to host utterances comments #}
{# utterances script to load the widget #} {% endif %} {%- endmacro add_comments -%}