-
Notifications
You must be signed in to change notification settings - Fork 0
/
giscus.html
32 lines (29 loc) · 1.24 KB
/
giscus.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<script>
document.addEventListener("DOMContentLoaded", function () {
if (!/posts/.test(location.pathname)) {
return;
}
var script = document.createElement("script");
script.src = "https://giscus.app/client.js";
script.setAttribute("data-repo", "andrewcstewart/andrewcstewart.github.io");
script.setAttribute("data-repo-id", "MDEwOlJlcG9zaXRvcnkxOTY4MjI0MA==");
script.setAttribute("data-category", "Comments");
script.setAttribute("data-category-id", "DIC_kwDOASxTwM4CQRjo");
script.setAttribute("data-mapping", "pathname");
script.setAttribute("data-reactions-enabled", "1");
script.setAttribute("data-emit-metadata", "0");
script.setAttribute("data-theme", "light");
script.setAttribute("data-lang", "en");
/* wait for article to load, append script to article element */
var observer = new MutationObserver(function (mutations, observer) {
var article = document.querySelector("d-article");
if (article) {
observer.disconnect();
/* HACK: article scroll */
article.setAttribute("style", "overflow-y: hidden");
article.appendChild(script);
}
});
observer.observe(document.body, { childList: true });
});
</script>