-
Notifications
You must be signed in to change notification settings - Fork 0
/
giscus.html
32 lines (29 loc) · 1.21 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", "L-Groeninger/lukas-r.blog");
script.setAttribute("data-repo-id", "R_kgDOGedlTQ");
script.setAttribute("data-category", "Comments");
script.setAttribute("data-category-id", "DIC_kwDOGedlTc4CAMnH");
script.setAttribute("data-mapping", "pathname");
script.setAttribute("data-reactions-enabled", "0");
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>