From 92a2e6bf16bbfbac978024ba21f51b2a4288e96f Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Thu, 19 Dec 2024 19:51:55 -0500 Subject: [PATCH] fix(giscus): add missing attributes and allow local theme --- _config.yml | 6 +++++- _includes/giscus-comment.html | 12 +++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/_config.yml b/_config.yml index afd365060315..3e841f6700a9 100644 --- a/_config.yml +++ b/_config.yml @@ -239,9 +239,13 @@ footer-hover-col: "#0085A1" # category: Announcements # Category name of your GitHub Discussion posts # category-id: # ID of your category, retrieve this info from https://giscus.app # mapping: pathname +# strict: 0 # reactions-enabled: 1 # emit-metadata: 0 -# theme: light +# input-position: bottom +# theme: light # custom themes supported such as a url (https://example.com/path/to/theme.css) or local path (/assets/css/giscus.css) +# lang: en +# lazy-loading: true ################ # --- Misc --- # diff --git a/_includes/giscus-comment.html b/_includes/giscus-comment.html index b6e7fa164215..89dfeee61e44 100644 --- a/_includes/giscus-comment.html +++ b/_includes/giscus-comment.html @@ -6,9 +6,19 @@ data-category="{{ site.giscus.category }}" data-category-id="{{ site.giscus.category-id }}" data-mapping="{{ site.giscus.mapping }}" + data-strict="{{ site.giscus.strict }}" data-reactions-enabled="{{ site.giscus.reactions-enabled }}" data-emit-metadata="{{ site.giscus.emit-metadata }}" - data-theme="{{ site.giscus.theme }}" + data-input-position="{{ site.giscus.input-position }}" + {% assign theme = site.giscus.theme %} + {% if theme | slice: 0 == '/' %} + {% assign theme = theme | absolute_url %} + {% endif %} + data-theme="{{ theme }}" + data-lang="{{ site.giscus.lang }}" + {% if site.giscus.lazy-loading == true %} + data-loading="lazy" + {% endif %} crossorigin="anonymous" async>