Skip to content

Commit 9615c4c

Browse files
committed
docs: Add new Giscus comment system
1 parent 92b49b9 commit 9615c4c

10 files changed

+61
-9
lines changed

docs/blog/2020/7.0-release.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
disqus: emacs-lsp
2+
template: comment.html
33
---
44

55
# 7.0 Release

docs/manual-language-docs/lsp-rust-analyzer.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
author: yyoncho
3-
disqus: emacs-lsp
3+
template: comment.html
44
root_file: docs/manual-language-docs/lsp-rust-analyzer.md
55
---
66
## Server note

docs/manual-language-docs/lsp-terraform-ls.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
author: psibi
3-
disqus: emacs-lsp
3+
template: comment.html
44
root_file: docs/manual-language-docs/lsp-terraform-ls.md
55
---
66

docs/tutorials/CPP-guide.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
disqus: emacs-lsp
2+
template: comment.html
33
root_file: docs/tutorials/CPP-guide.md
44
---
55

docs/tutorials/clojure-guide.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
author: ericdallo
3-
disqus: emacs-lsp
3+
template: comment.html
44
root_file: docs/tutorials/clojure-guide.md
55
---
66

docs/tutorials/debugging-clojure-script.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
author: yyoncho
3-
disqus: emacs-lsp
3+
template: comment.html
44
root_file: docs/tutorials/debugging-clojure-script.md
55
---
66
# Debugging ClojureScript using dap-mode

docs/tutorials/how-to-turn-off.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
disqus: emacs-lsp
2+
template: comment.html
33
root_file: docs/tutorials/how-to-turn-off.md
44
---
55

docs/tutorials/php-guide.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
disqus: emacs-lsp
2+
template: comment.html
33
author: elken
44
root_file: docs/tutorials/php-guide.md
55
---

docs/tutorials/reactjs-tutorial.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ContentId: 2dd2eeff-2eb3-4a0c-a59d-ea9a0b10c468
66
PageTitle: React JavaScript Tutorial in Emacs
77
DateApproved: 9/10/2020
88
MetaDescription: React JavaScript tutorial showing IntelliSense, debugging, and code navigation support in the Emacs editor.
9-
disqus: emacs-lsp
9+
template: comment.html
1010
root_file: docs/tutorials/reactjs-tutorial.md
1111
---
1212
# Using React in Emacs

overrides/comment.html

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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

Comments
 (0)