|
| 1 | +{% extends "base.html" %} |
| 2 | + |
| 3 | +{% block content %} |
| 4 | + {{ super() }} |
| 5 | + |
| 6 | + <!-- Giscus --> |
| 7 | + <h2 id="__comments">{{ lang.t("meta.comments") }}</h2> |
| 8 | + <!-- Replace with generated snippet --> |
| 9 | + <script src="https://giscus.app/client.js" |
| 10 | + data-repo="emacs-lsp/lsp-mode" |
| 11 | + data-repo-id="MDEwOlJlcG9zaXRvcnk3NTQxNTE2OQ==" |
| 12 | + data-category="Giscus" |
| 13 | + data-category-id="DIC_kwDOBH6-gc4CPloy" |
| 14 | + data-mapping="title" |
| 15 | + data-reactions-enabled="1" |
| 16 | + data-emit-metadata="0" |
| 17 | + data-input-position="bottom" |
| 18 | + data-theme="light" |
| 19 | + data-lang="en" |
| 20 | + data-loading="lazy" |
| 21 | + crossorigin="anonymous" |
| 22 | + async> |
| 23 | + </script> |
| 24 | + |
| 25 | + <!-- Reload on palette change --> |
| 26 | + <script> |
| 27 | + var palette = __md_get("__palette") |
| 28 | + if (palette && typeof palette.color === "object") |
| 29 | + if (palette.color.scheme === "slate") { |
| 30 | + var giscus = document.querySelector("script[src*=giscus]") |
| 31 | + giscus.setAttribute("data-theme", "dark") |
| 32 | + } |
| 33 | + |
| 34 | + /* Register event handlers after documented loaded */ |
| 35 | + document.addEventListener("DOMContentLoaded", function() { |
| 36 | + var ref = document.querySelector("[data-md-component=palette]") |
| 37 | + ref.addEventListener("change", function() { |
| 38 | + var palette = __md_get("__palette") |
| 39 | + if (palette && typeof palette.color === "object") { |
| 40 | + var theme = palette.color.scheme === "slate" ? "dark" : "light" |
| 41 | + |
| 42 | + /* Instruct Giscus to change theme */ |
| 43 | + var frame = document.querySelector(".giscus-frame") |
| 44 | + frame.contentWindow.postMessage( |
| 45 | + { giscus: { setConfig: { theme } } }, |
| 46 | + "https://giscus.app" |
| 47 | + ) |
| 48 | + } |
| 49 | + }) |
| 50 | + }) |
| 51 | + </script> |
| 52 | +{% endblock %} |
0 commit comments