Skip to content

Commit 65ccb62

Browse files
fix(giscus): add missing attributes and allow local theme
1 parent acbcdd8 commit 65ccb62

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

_config.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,13 @@ footer-hover-col: "#0085A1"
241241
# category: Announcements # Category name of your GitHub Discussion posts
242242
# category-id: # ID of your category, retrieve this info from https://giscus.app
243243
# mapping: pathname
244+
# strict: 0
244245
# reactions-enabled: 1
245246
# emit-metadata: 0
246-
# theme: light
247+
# input-position: bottom
248+
# theme: light # custom themes supported such as a url (https://example.com/path/to/theme.css) or local path (/assets/css/giscus.css)
249+
# lang: en
250+
# lazy-loading: true
247251

248252
################
249253
# --- Misc --- #

_includes/giscus-comment.html

Lines changed: 11 additions & 1 deletion
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)