<!--
SPDX-FileCopyrightText: 2024 Nicco Kunzmann and Open Web Calendar Contributors <https://open-web-calendar.quelltext.eu/>

SPDX-License-Identifier: CC-BY-SA-4.0


from https://giscus.app/
See also:
- https://zhauniarovich.com/post/2021/2021-06-giscus/

The `title` parameter defines the match of the category for discussion.

-->
{% if page.meta.comments %}
  <h2 id="__comments">{{ lang.t("meta.comments") }}</h2>
  <script src="&#x68;&#x74;&#x74;&#x70;&#x73;&#x3a;&#x2f;&#x2f;&#x67;&#x69;&#x73;&#x63;&#x75;&#x73;&#x2e;&#x61;&#x70;&#x70;&#x2f;&#x63;&#x6c;&#x69;&#x65;&#x6e;&#x74;&#x2e;&#x6a;&#x73;"
            data-repo="niccokunzmann/open-web-calendar"
            data-repo-id="MDEwOlJlcG9zaXRvcnkxNzA4ODYyNzY="
            data-category-id="DIC_kwDOCi-EhM4CesB-"
            data-mapping="og:title"
            data-strict="0"
            data-reactions-enabled="1"
            data-emit-metadata="0"
            data-input-position="top"
            data-theme="noborder_light"
            data-lang="en"
            data-loading="lazy"
            crossorigin="anonymous"
            async>
  </script>
  <!-- Synchronize Giscus theme with palette -->
<!--  <script>
    var giscus = document.querySelector("script[src*=giscus]")

    // Set palette on initial load
    var palette = __md_get("__palette")
    if (palette && typeof palette.color === "object") {
      var theme = palette.color.scheme === "slate"
        ? "transparent_dark"
        : "light"

      // Instruct Giscus to set theme
      giscus.setAttribute("data-theme", theme)
    }

    // Register event handlers after documented loaded
    document.addEventListener("DOMContentLoaded", function() {
      var ref = document.querySelector("[data-md-component=palette]")
      ref.addEventListener("change", function() {
        var palette = __md_get("__palette")
        if (palette && typeof palette.color === "object") {
          var theme = palette.color.scheme === "slate"
            ? "transparent_dark"
            : "light"

          // Instruct Giscus to change theme
          var frame = document.querySelector(".giscus-frame")
          frame.contentWindow.postMessage(
            { giscus: { setConfig: { theme } } },
            "https://giscus.app"
          )
        }
      })
    })
  </script>-->
{% endif %}
