<!-- Google Tag Manager -->
<script>
  (function (w, d, s, l, i) {
    w[l] = w[l] || [];
    w[l].push({ "gtm.start": new Date().getTime(), event: "gtm.js" });
    var f = d.getElementsByTagName(s)[0],
      j = d.createElement(s),
      dl = l != "dataLayer" ? "&l=" + l : "";
    j.async = true;
    j.src = "https://www.googletagmanager.com/gtm.js?id=" + i + dl;
    f.parentNode.insertBefore(j, f);
  })(window, document, "script", "dataLayer", "GTM-KV83JWN");
</script>
<!-- End Google Tag Manager -->

{% extends "base.html" %} {% block content %} {{ super() }}

<!-- Giscus -->
<script
  src="https://giscus.app/client.js"
  data-repo="ZhiyuanChen/DanLing"
  data-repo-id="R_kgDOGv-RWA"
  data-category="General"
  data-category-id="DIC_kwDOGv-RWM4CTx_d"
  data-mapping="pathname"
  data-strict="0"
  data-reactions-enabled="1"
  data-emit-metadata="1"
  data-input-position="top"
  data-theme="preferred_color_scheme"
  data-lang="en"
  data-loading="lazy"
  crossorigin="anonymous"
  async
></script>

<!-- Reload on palette change -->
<script>
  var palette = __md_get("__palette");
  if (palette && typeof palette.color === "object")
    if (palette.color.scheme === "slate") {
      var giscus = document.querySelector("script[src*=giscus]");
      giscus.setAttribute("data-theme", "dark");
    }

  /* 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" ? "dark" : "light";

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

<!-- Google Tag Manager (noscript) -->
<noscript
  ><iframe
    src="https://www.googletagmanager.com/ns.html?id=GTM-KV83JWN"
    height="0"
    width="0"
    style="display: none; visibility: hidden"
  ></iframe
></noscript>
<!-- End Google Tag Manager (noscript) -->
