-
Notifications
You must be signed in to change notification settings - Fork 2
/
utterances.html
37 lines (33 loc) · 1.25 KB
/
utterances.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
33
34
35
36
37
<script>
document.addEventListener("DOMContentLoaded", function () {
if (!/posts/.test(location.pathname)) {
return;
}
var script = document.createElement("script");
script.src = "https://utteranc.es/client.js";
script.setAttribute("repo", "sciencificity/Blog_Vebash");
script.setAttribute("issue-term", "title");
script.setAttribute("crossorigin", "anonymous");
script.setAttribute("label", "comments 💬");
script.setAttribute("theme", "github-light");
/* 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>
<!-- <script src="https://utteranc.es/client.js" -->
<!-- repo="sciencificity/Blog_Vebash" -->
<!-- issue-term="title" -->
<!-- label="comments 💬" -->
<!-- theme="github-light" -->
<!-- crossorigin="anonymous" -->
<!-- async> -->
<!-- </script> -->