Skip to content

Commit 6cdc13a

Browse files
Use giscus comments
1 parent d249cac commit 6cdc13a

File tree

3 files changed

+150
-6
lines changed

3 files changed

+150
-6
lines changed

_config_theme.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,33 @@ gtag: "G-0NFSCW63S2" # TODO: Update this with your own Google Analytics tag ID
231231
# "repository" (make sure the repository is public), (2) Enable Issues in your repository,
232232
# (3) Install the Utterances app in your repository https://github.com/apps/utterances
233233
# See more details about the parameters below at https://utteranc.es/
234-
utterances:
234+
# utterances:
235+
# repository: LizardByte/community # GitHub username/repository eg. "daattali/beautiful-jekyll"
236+
# issue-term: pathname # Mapping between blog posts and GitHub issues
237+
# theme: gruvbox-dark # Utterances theme
238+
# label: blog-comments # Label that will be assigned to GitHub Issues created by Utterances
239+
240+
# To use giscus comments:
241+
# (0) Uncomment the following giscus section, (1) Enable Discussions in your GitHub repository,
242+
# (2) Install the giscus app in your repository (details at https://giscus.app),
243+
# (3) Fill in *all* the parameters below
244+
# See more details about giscus and each of the following parameters at https://giscus.app
245+
giscus:
246+
hostname: giscus.app # Replace with your giscus instance's hostname if self-hosting
235247
repository: LizardByte/community # GitHub username/repository eg. "daattali/beautiful-jekyll"
236-
issue-term: title # Mapping between blog posts and GitHub issues
237-
theme: gruvbox-dark # Utterances theme
238-
label: blog-comments # Label that will be assigned to GitHub Issues created by Utterances
239-
240-
# other options for comments are staticman and giscus
248+
repository-id: R_kgDOMzlnmw # ID of your repository, retrieve this info from https://giscus.app
249+
category: Announcements # Category name of your GitHub Discussion posts
250+
category-id: DIC_kwDOMzlnm84Cil5m # ID of your category, retrieve this info from https://giscus.app
251+
mapping: pathname
252+
strict: 1
253+
reactions-enabled: 1
254+
emit-metadata: 0
255+
input-position: top
256+
theme: /assets/css/giscus.css
257+
lang: en
258+
lazy-loading: true
259+
260+
# other options for comments are staticman
241261

242262
################
243263
# --- Misc --- #

_includes/giscus-comment.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{% if site.giscus.repository and site.giscus.hostname %}
2+
3+
<script src="https://{{ site.giscus.hostname }}/client.js"
4+
data-repo="{{ site.giscus.repository }}"
5+
data-repo-id="{{ site.giscus.repository-id }}"
6+
data-category="{{ site.giscus.category }}"
7+
data-category-id="{{ site.giscus.category-id }}"
8+
data-mapping="{{ site.giscus.mapping }}"
9+
data-strict="{{ site.giscus.strict }}"
10+
data-reactions-enabled="{{ site.giscus.reactions-enabled }}"
11+
data-emit-metadata="{{ site.giscus.emit-metadata }}"
12+
data-input-position="{{ site.giscus.input-position }}"
13+
{% assign theme = site.giscus.theme %}
14+
{% if theme | slice: 0 == '/' %}
15+
{% assign theme = theme | absolute_url %}
16+
{% endif %}
17+
data-theme="{{ theme }}"
18+
data-lang="{{ site.giscus.lang }}"
19+
{% if site.giscus.lazy-loading == true %}
20+
data-loading="lazy"
21+
{% endif %}
22+
crossorigin="anonymous"
23+
async>
24+
</script>
25+
26+
{% endif %}

assets/css/giscus.css

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/*! MIT License
2+
* Copyright (c) 2018 GitHub Inc.
3+
* https://github.com/primer/primitives/blob/main/LICENSE
4+
*/
5+
main {
6+
--color-prettylights-syntax-comment: #8b949e;
7+
--color-prettylights-syntax-constant: #79c0ff;
8+
--color-prettylights-syntax-entity: #d2a8ff;
9+
--color-prettylights-syntax-storage-modifier-import: #c9d1d9;
10+
--color-prettylights-syntax-entity-tag: #7ee787;
11+
--color-prettylights-syntax-keyword: #ff7b72;
12+
--color-prettylights-syntax-string: #a5d6ff;
13+
--color-prettylights-syntax-variable: #ffa657;
14+
--color-prettylights-syntax-brackethighlighter-unmatched: #f85149;
15+
--color-prettylights-syntax-invalid-illegal-text: #f0f6fc;
16+
--color-prettylights-syntax-invalid-illegal-bg: #8e1519;
17+
--color-prettylights-syntax-carriage-return-text: #f0f6fc;
18+
--color-prettylights-syntax-carriage-return-bg: #b62324;
19+
--color-prettylights-syntax-string-regexp: #7ee787;
20+
--color-prettylights-syntax-markup-list: #f2cc60;
21+
--color-prettylights-syntax-markup-heading: #1f6feb;
22+
--color-prettylights-syntax-markup-italic: #c9d1d9;
23+
--color-prettylights-syntax-markup-bold: #c9d1d9;
24+
--color-prettylights-syntax-markup-deleted-text: #ffdcd7;
25+
--color-prettylights-syntax-markup-deleted-bg: #67060c;
26+
--color-prettylights-syntax-markup-inserted-text: #aff5b4;
27+
--color-prettylights-syntax-markup-inserted-bg: #033a16;
28+
--color-prettylights-syntax-markup-changed-text: #ffdfb6;
29+
--color-prettylights-syntax-markup-changed-bg: #5a1e02;
30+
--color-prettylights-syntax-markup-ignored-text: #c9d1d9;
31+
--color-prettylights-syntax-markup-ignored-bg: #1158c7;
32+
--color-prettylights-syntax-meta-diff-range: #d2a8ff;
33+
--color-prettylights-syntax-brackethighlighter-angle: #8b949e;
34+
--color-prettylights-syntax-sublimelinter-gutter-mark: #484f58;
35+
--color-prettylights-syntax-constant-other-reference-link: #a5d6ff;
36+
--color-btn-text: #c9d1d9;
37+
--color-btn-bg: #21262d;
38+
--color-btn-border: #f0f6fc1a;
39+
--color-btn-shadow: 0 0 #0000;
40+
--color-btn-inset-shadow: 0 0 #0000;
41+
--color-btn-hover-bg: #30363d;
42+
--color-btn-hover-border: #8b949e;
43+
--color-btn-active-bg: #282e33;
44+
--color-btn-active-border: #6e7681;
45+
--color-btn-selected-bg: #161b22;
46+
--color-btn-primary-text: #fff;
47+
--color-btn-primary-bg: #238636;
48+
--color-btn-primary-border: #f0f6fc1a;
49+
--color-btn-primary-shadow: 0 0 #0000;
50+
--color-btn-primary-inset-shadow: 0 0 #0000;
51+
--color-btn-primary-hover-bg: #2ea043;
52+
--color-btn-primary-hover-border: #f0f6fc1a;
53+
--color-btn-primary-selected-bg: #238636;
54+
--color-btn-primary-selected-shadow: 0 0 #0000;
55+
--color-btn-primary-disabled-text: #ffffff80;
56+
--color-btn-primary-disabled-bg: #23863699;
57+
--color-btn-primary-disabled-border: #f0f6fc1a;
58+
--color-action-list-item-default-hover-bg: #b1bac41f;
59+
--color-segmented-control-bg: #6e76811a;
60+
--color-segmented-control-button-bg: #0d1117;
61+
--color-segmented-control-button-selected-border: #6e7681;
62+
--color-fg-default: #e6edf3;
63+
--color-fg-muted: #7d8590;
64+
--color-fg-subtle: #6e7681;
65+
--color-canvas-default: #242526;
66+
--color-canvas-overlay: #161b22;
67+
--color-canvas-inset: #151515;
68+
--color-canvas-subtle: #303436;
69+
--color-border-default: #30363d;
70+
--color-border-muted: #21262d;
71+
--color-neutral-muted: #6e768166;
72+
--color-accent-fg: #2f81f7;
73+
--color-accent-emphasis: #1f6feb;
74+
--color-accent-muted: #388bfd66;
75+
--color-accent-subtle: #388bfd1a;
76+
--color-success-fg: #3fb950;
77+
--color-attention-fg: #d29922;
78+
--color-attention-muted: #bb800966;
79+
--color-attention-subtle: #bb800926;
80+
--color-danger-fg: #f85149;
81+
--color-danger-muted: #f8514966;
82+
--color-danger-subtle: #f851491a;
83+
--color-primer-shadow-inset: 0 0 #0000;
84+
--color-scale-gray-7: #21262d;
85+
--color-scale-blue-8: #0c2d6b;
86+
87+
/*! Extensions from @primer/css/alerts/flash.scss */
88+
--color-social-reaction-bg-hover: var(--color-scale-gray-7);
89+
--color-social-reaction-bg-reacted-hover: var(--color-scale-blue-8)
90+
}
91+
92+
main .pagination-loader-container {
93+
background-image: url(https://github.com/images/modules/pulls/progressive-disclosure-line-dark.svg)
94+
}
95+
96+
main .gsc-loading-image {
97+
background-image: url(https://github.githubassets.com/images/mona-loading-dark.gif)
98+
}

0 commit comments

Comments
 (0)