{% macro content(page) %} {% set separator = config.extra.separator | default(value="•") %}
{{ page.title }}
{% if page.extra.tldr %}

TL;DR:

{{ page.extra.tldr }}

{% endif %} {# Optional table of contents #} {% set toc_levels = page.extra.toc_levels | default(value=3) %} {% if page.extra.toc | default(value=false) %} {% if page.toc %}

{%- if lang != config.default_language %} {{ trans(key="table_of_contents" | safe, lang=lang) }} {% else %} Table of Contents {% endif %}

    {% for h1 in page.toc %}
  • {{ h1.title }} {% if h1.children and toc_levels > 1 %}
      {% for h2 in h1.children %}
    • {{ h2.title }} {% if h2.children and toc_levels > 2 %} {% endif %}
    • {% endfor %}
    {% endif %}
  • {% endfor %}
{% endif %} {% endif %}
{{ page.content | safe }}
{# 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 %} {% set isso_enabled = config.extra.isso.enabled_for_all_posts or page.extra.isso %} {# Ensure only one comment system is enabled #} {# Counter for enabled comment systems #} {% set enabled_systems = 0 %} {# Check and count the enabled comment systems #} {% if giscus_enabled %} {% set comment_system = "giscus" %} {% set enabled_systems = enabled_systems + 1 %} {% endif %} {% if utterances_enabled %} {% set comment_system = "utterances" %} {% set enabled_systems = enabled_systems + 1 %} {% endif %} {% if hyvortalk_enabled %} {% set comment_system = "hyvortalk" %} {% set enabled_systems = enabled_systems + 1 %} {% endif %} {% if isso_enabled %} {% set comment_system = "isso" %} {% set enabled_systems = enabled_systems + 1 %} {% endif %} {# Ensure only one comment system is enabled #} {% if enabled_systems > 1 %} {{ 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.") }} {% endif %} {% if comment_system %} {% set automatic_loading = config.extra[comment_system].automatic_loading %} {{ macros_add_comments::add_comments(comment_system=comment_system, automatic_loading=automatic_loading) }} {% endif %}
{% if config.extra.quick_navigation_buttons or page.extra.quick_navigation_buttons %}
{% if comment_system %} {% endif %}
{% endif %} {% endmacro content %}