Skip to content

Commit 92a2e6b

Browse files
fix(giscus): add missing attributes and allow local theme
1 parent b1b667e commit 92a2e6b

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

_config.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,13 @@ footer-hover-col: "#0085A1"
239239
# category: Announcements # Category name of your GitHub Discussion posts
240240
# category-id: # ID of your category, retrieve this info from https://giscus.app
241241
# mapping: pathname
242+
# strict: 0
242243
# reactions-enabled: 1
243244
# emit-metadata: 0
244-
# theme: light
245+
# input-position: bottom
246+
# theme: light # custom themes supported such as a url (https://example.com/path/to/theme.css) or local path (/assets/css/giscus.css)
247+
# lang: en
248+
# lazy-loading: true
245249

246250
################
247251
# --- Misc --- #

_includes/giscus-comment.html

+11-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,19 @@
66
data-category="{{ site.giscus.category }}"
77
data-category-id="{{ site.giscus.category-id }}"
88
data-mapping="{{ site.giscus.mapping }}"
9+
data-strict="{{ site.giscus.strict }}"
910
data-reactions-enabled="{{ site.giscus.reactions-enabled }}"
1011
data-emit-metadata="{{ site.giscus.emit-metadata }}"
11-
data-theme="{{ site.giscus.theme }}"
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 %}
1222
crossorigin="anonymous"
1323
async>
1424
</script>

0 commit comments

Comments
 (0)