From a7534a6b917ef9b7a5997087b28e201e1aab8ab0 Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Sat, 26 Jun 2021 10:52:57 -0400 Subject: [PATCH 01/21] Add script in same style as utterances But adjusted for the various filed differences --- _includes/comments-providers/giscus.html | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 _includes/comments-providers/giscus.html diff --git a/_includes/comments-providers/giscus.html b/_includes/comments-providers/giscus.html new file mode 100644 index 000000000000..0550298ce777 --- /dev/null +++ b/_includes/comments-providers/giscus.html @@ -0,0 +1,25 @@ + \ No newline at end of file From c9330c7ade190636af2af708f144ebb86aa88f95 Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Sat, 26 Jun 2021 10:59:38 -0400 Subject: [PATCH 02/21] Add initial script --- _includes/comments-providers/giscus.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/comments-providers/giscus.html b/_includes/comments-providers/giscus.html index 0550298ce777..1f183299ff42 100644 --- a/_includes/comments-providers/giscus.html +++ b/_includes/comments-providers/giscus.html @@ -14,7 +14,7 @@ script.setAttribute('data-repo-id', '{{ site.giscus.repo_id }}'); script.setAttribute('data-category', '{{ site.giscus.category_name }}'); script.setAttribute('data-category-id', '{{ site.giscus.category_id }}'); - script.setAttribute('data-mapping', '{{ site.comments.giscus.issue_term | default: "pathname" }}'); + script.setAttribute('data-mapping', '{{ site.comments.giscus.discussion_term | default: "pathname" }}'); script.setAttribute('data-reactions-enabled', '{{ site.comments.giscus.reactions_enabled | default: 1 }}'); // TODO: Convert from boolean script.setAttribute('data-theme', '{{ site.comments.giscus.theme | default: "light" }}'); script.setAttribute('crossorigin', 'anonymous'); From b0d5b1e0e704ba335762294e008704fa1096e0c4 Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Sat, 26 Jun 2021 10:59:44 -0400 Subject: [PATCH 03/21] Add default settings --- _config.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index 2135c6f042e5..e6d648219557 100644 --- a/_config.yml +++ b/_config.yml @@ -30,7 +30,7 @@ masthead_title : # overrides the website title displayed in the masthe # breadcrumbs : false # true, false (default) words_per_minute : 200 comments: - provider : # false (default), "disqus", "discourse", "facebook", "staticman", "staticman_v2", "utterances", "custom" + provider : # false (default), "disqus", "discourse", "facebook", "staticman", "staticman_v2", "utterances", "giscus", "custom" disqus: shortname : # https://help.disqus.com/customer/portal/articles/466208-what-s-a-shortname- discourse: @@ -43,6 +43,13 @@ comments: utterances: theme : # "github-light" (default), "github-dark" issue_term : # "pathname" (default) + giscus: + repo_id : # Shown during giscus setup + category_name : # Full text name of the category + category_id : # Shown during giscus setup + discussion_term : # "pathname" (default), "url", "title", "og:title" + reactions_enabled : # true (default), false + theme : # "light" (default), "dark", "dark_dimmed", "transparent_dark", "preferred_color_scheme" staticman: branch : # "master" endpoint : # "https://{your Staticman v3 API}/v3/entry/github/" From 3348c578a12d32fde20da13900e6818f05b43a29 Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Sat, 26 Jun 2021 11:04:47 -0400 Subject: [PATCH 04/21] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a841561f17dd..18ed23609472 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Remove `h2` from skip links navigation as it is not important for site structure. [#3012](https://github.com/mmistakes/minimal-mistakes/pull/3012) - Loads Font Awesome asynchronously. [#2967](https://github.com/mmistakes/minimal-mistakes/pull/2967) - Replace custom search icon SVG with Font Awesome icon. [#2774](https://github.com/mmistakes/minimal-mistakes/pull/2774) +- Adds support for giscus comments. [#3022](https://github.com/mmistakes/minimal-mistakes/pull/3022) ### Enhancements From 31b83b9d4a692f56cd8c61d94ab8a7b5d2bc097e Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Sat, 26 Jun 2021 11:04:52 -0400 Subject: [PATCH 05/21] Add feature to readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e97b16120e1..d37a76102533 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Minimal Mistakes is a flexible two-column Jekyll theme, perfect for building per - Several responsive layout options (single, archive index, search, splash, and paginated home page). - Optimized for search engines with support for [Twitter Cards](https://dev.twitter.com/cards/overview) and [Open Graph](http://ogp.me/) data. - Optional [header images](https://mmistakes.github.io/minimal-mistakes/docs/layouts/#headers), [custom sidebars](https://mmistakes.github.io/minimal-mistakes/docs/layouts/#sidebars), [table of contents](https://mmistakes.github.io/minimal-mistakes/docs/helpers/#table-of-contents), [galleries](https://mmistakes.github.io/minimal-mistakes/docs/helpers/#gallery), related posts, [breadcrumb links](https://mmistakes.github.io/minimal-mistakes/docs/configuration/#breadcrumb-navigation-beta), [navigation lists](https://mmistakes.github.io/minimal-mistakes/docs/helpers/#navigation-list), and more. -- Commenting support (powered by [Disqus](https://disqus.com/), [Facebook](https://developers.facebook.com/docs/plugins/comments), Google+, [Discourse](https://www.discourse.org/), static-based via [Staticman](https://staticman.net/), and [utterances](https://utteranc.es/)). +- Commenting support (powered by [Disqus](https://disqus.com/), [Facebook](https://developers.facebook.com/docs/plugins/comments), Google+, [Discourse](https://www.discourse.org/), static-based via [Staticman](https://staticman.net/), [utterances](https://utteranc.es/), and [giscus](https://giscus.app/)). - [Google Analytics](https://www.google.com/analytics/) support. - UI localized text in English (default), Arabic (عربي), Brazilian Portuguese (Português brasileiro), Catalan, Chinese, Danish, Dutch, Finnish, French (Français), German (Deutsch), Greek, Hebrew, Hindi (हिंदी), Hungarian, Indonesian, Irish (Gaeilge), Italian (Italiano), Japanese, Korean, Malayalam, Myanmar (Burmese), Nepali (Nepalese), Norwegian (Norsk), Persian (فارسی), Polish, Punjabi (ਪੰਜਾਬੀ), Romanian, Russian, Slovak, Spanish (Español), Swedish, Thai, Turkish (Türkçe), and Vietnamese. From c6bccbd7577c249c2da7ea687bfcf6f4c2084944 Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Sat, 26 Jun 2021 11:06:18 -0400 Subject: [PATCH 06/21] Add comments html --- _includes/comments.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/_includes/comments.html b/_includes/comments.html index b23cea4d3f41..4ff59e270347 100644 --- a/_includes/comments.html +++ b/_includes/comments.html @@ -153,6 +153,9 @@

{{ site.data.ui-text[site.locale].comments_labe {% when "utterances" %}

{{ comments_label }}

+ {% when "giscus" %} +

{{ comments_label }}

+
{% when "custom" %} {% include /comments-providers/custom.html %} {% endcase %} From f8844d721d50e1f0137fcb4bcb7fd85565b26eaf Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Sat, 26 Jun 2021 11:08:03 -0400 Subject: [PATCH 07/21] add comment provider include --- _includes/comments-providers/scripts.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/_includes/comments-providers/scripts.html b/_includes/comments-providers/scripts.html index c550618fe552..e87badabd365 100644 --- a/_includes/comments-providers/scripts.html +++ b/_includes/comments-providers/scripts.html @@ -12,6 +12,8 @@ {% include /comments-providers/staticman_v2.html %} {% when "utterances" %} {% include /comments-providers/utterances.html %} + {% when "giscus" %} + {% include /comments-providers/giscus.html %} {% when "custom" %} {% include /comments-providers/custom_scripts.html %} {% endcase %} From 481f36f360bd2c7b6449dfdadea215c5a3494662 Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Sat, 26 Jun 2021 11:08:09 -0400 Subject: [PATCH 08/21] update config in docs --- docs/_config.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/_config.yml b/docs/_config.yml index f3ac7cdbc0a1..829a2ec18ed2 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -25,7 +25,7 @@ masthead_title : # overrides the website title displayed in the masthe # breadcrumbs : false # true, false (default) words_per_minute : 200 comments: - provider : "false" # false (default), "disqus", "discourse", "facebook", "staticman_v2", "staticman", "utterances", "custom" + provider : "false" # false (default), "disqus", "discourse", "facebook", "staticman_v2", "staticman", "utterances", "giscus", "custom" disqus: shortname : discourse: @@ -38,6 +38,13 @@ comments: utterances: theme : # "github-light" (default), "github-dark" issue_term : # "pathname" (default) + giscus: + repo_id : # Shown during giscus setup + category_name : # Full text name of the category + category_id : # Shown during giscus setup + discussion_term : # "pathname" (default), "url", "title", "og:title" + reactions_enabled : # true (default), false + theme : # "light" (default), "dark", "dark_dimmed", "transparent_dark", "preferred_color_scheme" reCaptcha: siteKey : # "6LdRBykTAAAAAFB46MnIu6ixuxwu9W1ihFF8G60Q" secret : # "PznnZGu3P6eTHRPLORniSq+J61YEf+A9zmColXDM5icqF49gbunH51B8+h+i2IvewpuxtA9TFoK68TuhUp/X3YKmmqhXasegHYabY50fqF9nJh9npWNhvITdkQHeaOqnFXUIwxfiEeUt49Yoa2waRR7a5LdRAP3SVM8hz0KIBT4=" From c25025e2e617dcba2e02cdbc41796ab8ae47f790 Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Sat, 26 Jun 2021 11:15:34 -0400 Subject: [PATCH 09/21] Add URL for additional reference --- _config.yml | 4 ++-- docs/_config.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/_config.yml b/_config.yml index e6d648219557..89719f7ef652 100644 --- a/_config.yml +++ b/_config.yml @@ -44,9 +44,9 @@ comments: theme : # "github-light" (default), "github-dark" issue_term : # "pathname" (default) giscus: - repo_id : # Shown during giscus setup + repo_id : # Shown during giscus setup at https://giscus.app category_name : # Full text name of the category - category_id : # Shown during giscus setup + category_id : # Shown during giscus setup at https://giscus.app discussion_term : # "pathname" (default), "url", "title", "og:title" reactions_enabled : # true (default), false theme : # "light" (default), "dark", "dark_dimmed", "transparent_dark", "preferred_color_scheme" diff --git a/docs/_config.yml b/docs/_config.yml index 829a2ec18ed2..cbfdfceb9f16 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -39,9 +39,9 @@ comments: theme : # "github-light" (default), "github-dark" issue_term : # "pathname" (default) giscus: - repo_id : # Shown during giscus setup + repo_id : # Shown during giscus setup at https://giscus.app category_name : # Full text name of the category - category_id : # Shown during giscus setup + category_id : # Shown during giscus setup at https://giscus.app discussion_term : # "pathname" (default), "url", "title", "og:title" reactions_enabled : # true (default), false theme : # "light" (default), "dark", "dark_dimmed", "transparent_dark", "preferred_color_scheme" From 2108f6b7cae026c2ea03cecd17890a35f5f5ce76 Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Sat, 26 Jun 2021 11:15:49 -0400 Subject: [PATCH 10/21] docs for giscus comments --- docs/_docs/05-configuration.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/docs/_docs/05-configuration.md b/docs/_docs/05-configuration.md index a427c9cec7a6..73258396feaa 100644 --- a/docs/_docs/05-configuration.md +++ b/docs/_docs/05-configuration.md @@ -333,7 +333,7 @@ For example, ### Comments -[**Disqus**](https://disqus.com/), [**Discourse**](https://www.discourse.org/), [**Facebook**](https://developers.facebook.com/docs/plugins/comments), [**utterances**](https://utteranc.es/), and static-based commenting via [**Staticman**](https://staticman.net/) are built into the theme. First set the comment provider you'd like to use: +[**Disqus**](https://disqus.com/), [**Discourse**](https://www.discourse.org/), [**Facebook**](https://developers.facebook.com/docs/plugins/comments), [**utterances**](https://utteranc.es/), [**giscus**](https://giscus.app/) and static-based commenting via [**Staticman**](https://staticman.net/) are built into the theme. First set the comment provider you'd like to use: | Name | Comment Provider | | ---------------- | ------------------------- | @@ -343,6 +343,7 @@ For example, | **staticman_v2** | Staticman v2 / v3 | | **staticman** | Staticman v1 (deprecated) | | **utterances** | utterances | +| **giscus** | giscus | | **custom** | Other | Then add `comments: true` to each document you want comments visible on. @@ -424,6 +425,35 @@ comments: issue_term: "pathname" ``` +#### giscus comments + +To use giscus you will need to [install the app](https://github.com/apps/giscus) to your GitHub repository. + +The next step is to go to and fill out the desired settings. This will generate a javascript, which will provide you with some of the settings you will need to configure things below. + +You'll need to ensure you've added the following to `_config.yml`: + +```yaml +repository: # GitHub username/repo-name e.g. "mmistakes/minimal-mistakes" +``` + +**Note:** Make sure the repo is public, otherwise your readers will not be able to view the issues/comments. The [discussions feature](https://docs.github.com/en/discussions) also needs to be active on your repo. +{: .notice--warning} + +To enable giscus on the front end set `comments.provider` and the other additional options. + +```yaml +comments: + provider: "giscus" + giscus: + repo_id : # Shown during giscus setup at https://giscus.app + category_name : # Full text name of the category + category_id : # Shown during giscus setup at https://giscus.app + discussion_term : # "pathname" (default), "url", "title", "og:title" + reactions_enabled : # true (default), false + theme : # "light" (default), "dark", "dark_dimmed", "transparent_dark", "preferred_color_scheme" +``` + #### Static-based comments via Staticman Transform user comments into `_data` files that live inside of your GitHub repository by enabling Staticman. From 55d925aa7249c2a6e89dcf21027b87b08d753b27 Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Sat, 26 Jun 2021 11:18:55 -0400 Subject: [PATCH 11/21] Unrelated bugfix: add missing version separator So that things match the "history" doc. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18ed23609472..60d162a04d05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Loads Font Awesome asynchronously. [#2967](https://github.com/mmistakes/minimal-mistakes/pull/2967) - Replace custom search icon SVG with Font Awesome icon. [#2774](https://github.com/mmistakes/minimal-mistakes/pull/2774) - Adds support for giscus comments. [#3022](https://github.com/mmistakes/minimal-mistakes/pull/3022) +## [4.23.0](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.23.0) ### Enhancements From e6a042ec7188ecb5e7951c5b30c6a6e305eb5d34 Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Sat, 26 Jun 2021 11:19:22 -0400 Subject: [PATCH 12/21] add space --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60d162a04d05..b972d9ff8a40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Loads Font Awesome asynchronously. [#2967](https://github.com/mmistakes/minimal-mistakes/pull/2967) - Replace custom search icon SVG with Font Awesome icon. [#2774](https://github.com/mmistakes/minimal-mistakes/pull/2774) - Adds support for giscus comments. [#3022](https://github.com/mmistakes/minimal-mistakes/pull/3022) + ## [4.23.0](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.23.0) ### Enhancements From 2dae4a9c4a61d539f8c0c1c39233d2b0e8986ec0 Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Sat, 26 Jun 2021 11:19:42 -0400 Subject: [PATCH 13/21] update history doc --- docs/_docs/18-history.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/_docs/18-history.md b/docs/_docs/18-history.md index 9a364da02093..882b12531fce 100644 --- a/docs/_docs/18-history.md +++ b/docs/_docs/18-history.md @@ -22,6 +22,8 @@ toc: false - Remove `h2` from skip links navigation as it is not important for site structure. [#3012](https://github.com/mmistakes/minimal-mistakes/pull/3012) - Loads Font Awesome asynchronously. [#2967](https://github.com/mmistakes/minimal-mistakes/pull/2967) - Replace custom search icon SVG with Font Awesome icon. [#2774](https://github.com/mmistakes/minimal-mistakes/pull/2774) +- Adds support for giscus comments. [#3022](https://github.com/mmistakes/minimal-mistakes/pull/3022) + ## [4.23.0](https://github.com/mmistakes/minimal-mistakes/releases/tag/4.23.0) ### Enhancements From 50874cf06464ce4be969c8d35d3d206c5a192470 Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Sat, 26 Jun 2021 11:21:14 -0400 Subject: [PATCH 14/21] update about doc --- docs/_pages/about.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_pages/about.md b/docs/_pages/about.md index 23221aadb81b..09406fe60dd3 100644 --- a/docs/_pages/about.md +++ b/docs/_pages/about.md @@ -31,7 +31,7 @@ Minimal Mistakes is a flexible two-column Jekyll theme. Perfect for hosting your - Several responsive layout options (single, archive index, search, splash, and paginated home page). - Optimized for search engines with support for [Twitter Cards](https://dev.twitter.com/cards/overview) and [Open Graph](http://ogp.me/) data - Optional [header images](https://mmistakes.github.io/minimal-mistakes/docs/layouts/#headers), [custom sidebars](https://mmistakes.github.io/minimal-mistakes/docs/layouts/#sidebars), [table of contents](https://mmistakes.github.io/minimal-mistakes/docs/helpers/#table-of-contents), [galleries](https://mmistakes.github.io/minimal-mistakes/docs/helpers/#gallery), related posts, [breadcrumb links](https://mmistakes.github.io/minimal-mistakes/docs/configuration/#breadcrumb-navigation-beta), [navigation lists](https://mmistakes.github.io/minimal-mistakes/docs/helpers/#navigation-list), and more. -- Commenting support (powered by [Disqus](https://disqus.com/), [Facebook](https://developers.facebook.com/docs/plugins/comments), [Discourse](https://www.discourse.org/), [utterances](https://utteranc.es/), static-based via [Staticman v1 and v2](https://staticman.net/), and custom). +- Commenting support (powered by [Disqus](https://disqus.com/), [Facebook](https://developers.facebook.com/docs/plugins/comments), [Discourse](https://www.discourse.org/), [utterances](https://utteranc.es/), [giscus](https://giscus.app/), static-based via [Staticman v1 and v2](https://staticman.net/), and custom). - [Google Analytics](https://www.google.com/analytics/) support. - UI localized text in English (default), Arabic (عربي), Brazilian Portuguese (Português brasileiro), Catalan, Chinese, Danish, Dutch, Finnish, French (Français), German (Deutsch), Greek, Hebrew, Hindi (हिंदी), Hungarian, Indonesian, Irish (Gaeilge), Italian (Italiano), Japanese, Korean, Malayalam, Myanmar (Burmese), Nepali (Nepalese), Norwegian (Norsk), Persian (فارسی), Polish, Punjabi (ਪੰਜਾਬੀ), Romanian, Russian, Slovak, Spanish (Español), Swedish, Thai, Turkish (Türkçe), and Vietnamese. From 80c1db4e9d4cd943b383226b25d2cdc92bde8d47 Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Sat, 26 Jun 2021 11:21:19 -0400 Subject: [PATCH 15/21] add to test config yaml --- test/_config.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/_config.yml b/test/_config.yml index a97378940dfc..ea2af39b1675 100644 --- a/test/_config.yml +++ b/test/_config.yml @@ -24,7 +24,7 @@ masthead_title : "Custom Title" # overrides the website title displaye # breadcrumbs : false # true, false (default) words_per_minute : 200 comments: - provider : # false (default), "disqus", "discourse", "facebook", "staticman", "utterances", "custom" + provider : # false (default), "disqus", "discourse", "facebook", "staticman", "utterances", "giscus", "custom" disqus: shortname : # https://help.disqus.com/customer/portal/articles/466208-what-s-a-shortname- discourse: @@ -37,6 +37,13 @@ comments: utterances: theme : # "github-light" (default), "github-dark" issue_term : # "pathname" (default) + giscus: + repo_id : # Shown during giscus setup at https://giscus.app + category_name : # Full text name of the category + category_id : # Shown during giscus setup at https://giscus.app + discussion_term : # "pathname" (default), "url", "title", "og:title" + reactions_enabled : # true (default), false + theme : # "light" (default), "dark", "dark_dimmed", "transparent_dark", "preferred_color_scheme" staticman: branch : # "master" endpoint : # "https://{your Staticman v3 API}/v3/entry/github/" From 5e8f92d292ef83069699aa20beaa6fd7b1af8ee8 Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Sat, 26 Jun 2021 12:49:45 -0400 Subject: [PATCH 16/21] remove unnecessary / incorrect async attribute --- _includes/comments-providers/giscus.html | 1 - 1 file changed, 1 deletion(-) diff --git a/_includes/comments-providers/giscus.html b/_includes/comments-providers/giscus.html index 1f183299ff42..6d4783156816 100644 --- a/_includes/comments-providers/giscus.html +++ b/_includes/comments-providers/giscus.html @@ -18,7 +18,6 @@ script.setAttribute('data-reactions-enabled', '{{ site.comments.giscus.reactions_enabled | default: 1 }}'); // TODO: Convert from boolean script.setAttribute('data-theme', '{{ site.comments.giscus.theme | default: "light" }}'); script.setAttribute('crossorigin', 'anonymous'); - script.setAttribute('async'); commentContainer.appendChild(script); })(); From 655abdd68e2907d596637f7490a747e58621586a Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Sat, 26 Jun 2021 12:57:59 -0400 Subject: [PATCH 17/21] probably should pass the right config paths --- _includes/comments-providers/giscus.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_includes/comments-providers/giscus.html b/_includes/comments-providers/giscus.html index 6d4783156816..946b6d8af9d4 100644 --- a/_includes/comments-providers/giscus.html +++ b/_includes/comments-providers/giscus.html @@ -11,9 +11,9 @@ var script = document.createElement('script'); script.setAttribute('src', 'https://giscus.app/client.js'); script.setAttribute('data-repo', '{{ site.repository }}'); - script.setAttribute('data-repo-id', '{{ site.giscus.repo_id }}'); - script.setAttribute('data-category', '{{ site.giscus.category_name }}'); - script.setAttribute('data-category-id', '{{ site.giscus.category_id }}'); + script.setAttribute('data-repo-id', '{{ site.comments.giscus.repo_id }}'); + script.setAttribute('data-category', '{{ site.comments.giscus.category_name }}'); + script.setAttribute('data-category-id', '{{ site.comments.giscus.category_id }}'); script.setAttribute('data-mapping', '{{ site.comments.giscus.discussion_term | default: "pathname" }}'); script.setAttribute('data-reactions-enabled', '{{ site.comments.giscus.reactions_enabled | default: 1 }}'); // TODO: Convert from boolean script.setAttribute('data-theme', '{{ site.comments.giscus.theme | default: "light" }}'); From 5a04d58dbcf061f7a9346eac9d74ff5f806055e8 Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Sat, 26 Jun 2021 21:02:53 -0400 Subject: [PATCH 18/21] lowercase the repo name --- _includes/comments-providers/giscus.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/comments-providers/giscus.html b/_includes/comments-providers/giscus.html index 946b6d8af9d4..3c600af39023 100644 --- a/_includes/comments-providers/giscus.html +++ b/_includes/comments-providers/giscus.html @@ -10,7 +10,7 @@ var script = document.createElement('script'); script.setAttribute('src', 'https://giscus.app/client.js'); - script.setAttribute('data-repo', '{{ site.repository }}'); + script.setAttribute('data-repo', '{{ site.repository | downcase }}'); script.setAttribute('data-repo-id', '{{ site.comments.giscus.repo_id }}'); script.setAttribute('data-category', '{{ site.comments.giscus.category_name }}'); script.setAttribute('data-category-id', '{{ site.comments.giscus.category_id }}'); From 5fe9ae0b4c8a68ead5a82e0e4d557d3ee9d50e5f Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Sat, 26 Jun 2021 21:43:04 -0400 Subject: [PATCH 19/21] Update docs to address '1' and '0' for reactions_enabled Figured I'd match the giscus format rather than convert a boolean to an int there. --- _includes/comments-providers/giscus.html | 2 +- docs/_config.yml | 2 +- docs/_docs/05-configuration.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/_includes/comments-providers/giscus.html b/_includes/comments-providers/giscus.html index 3c600af39023..e89d41cea105 100644 --- a/_includes/comments-providers/giscus.html +++ b/_includes/comments-providers/giscus.html @@ -15,7 +15,7 @@ script.setAttribute('data-category', '{{ site.comments.giscus.category_name }}'); script.setAttribute('data-category-id', '{{ site.comments.giscus.category_id }}'); script.setAttribute('data-mapping', '{{ site.comments.giscus.discussion_term | default: "pathname" }}'); - script.setAttribute('data-reactions-enabled', '{{ site.comments.giscus.reactions_enabled | default: 1 }}'); // TODO: Convert from boolean + script.setAttribute('data-reactions-enabled', '{{ site.comments.giscus.reactions_enabled | default: 1 }}'); script.setAttribute('data-theme', '{{ site.comments.giscus.theme | default: "light" }}'); script.setAttribute('crossorigin', 'anonymous'); diff --git a/docs/_config.yml b/docs/_config.yml index cbfdfceb9f16..d2dff4b04616 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -43,7 +43,7 @@ comments: category_name : # Full text name of the category category_id : # Shown during giscus setup at https://giscus.app discussion_term : # "pathname" (default), "url", "title", "og:title" - reactions_enabled : # true (default), false + reactions_enabled : # '1' for enabled (default), '0' for disabled theme : # "light" (default), "dark", "dark_dimmed", "transparent_dark", "preferred_color_scheme" reCaptcha: siteKey : # "6LdRBykTAAAAAFB46MnIu6ixuxwu9W1ihFF8G60Q" diff --git a/docs/_docs/05-configuration.md b/docs/_docs/05-configuration.md index 73258396feaa..a08c334d0a5c 100644 --- a/docs/_docs/05-configuration.md +++ b/docs/_docs/05-configuration.md @@ -450,7 +450,7 @@ comments: category_name : # Full text name of the category category_id : # Shown during giscus setup at https://giscus.app discussion_term : # "pathname" (default), "url", "title", "og:title" - reactions_enabled : # true (default), false + reactions_enabled : # '1' for enabled (default), '0' for disabled theme : # "light" (default), "dark", "dark_dimmed", "transparent_dark", "preferred_color_scheme" ``` From 807c816b9a19b330d726490d28b0227ada986665 Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Sat, 26 Jun 2021 21:46:43 -0400 Subject: [PATCH 20/21] update two additional docs --- _config.yml | 2 +- test/_config.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_config.yml b/_config.yml index 89719f7ef652..ed24c3792514 100644 --- a/_config.yml +++ b/_config.yml @@ -48,7 +48,7 @@ comments: category_name : # Full text name of the category category_id : # Shown during giscus setup at https://giscus.app discussion_term : # "pathname" (default), "url", "title", "og:title" - reactions_enabled : # true (default), false + reactions_enabled : # '1' for enabled (default), '0' for disabled theme : # "light" (default), "dark", "dark_dimmed", "transparent_dark", "preferred_color_scheme" staticman: branch : # "master" diff --git a/test/_config.yml b/test/_config.yml index ea2af39b1675..2d09d9667132 100644 --- a/test/_config.yml +++ b/test/_config.yml @@ -42,7 +42,7 @@ comments: category_name : # Full text name of the category category_id : # Shown during giscus setup at https://giscus.app discussion_term : # "pathname" (default), "url", "title", "og:title" - reactions_enabled : # true (default), false + reactions_enabled : # '1' for enabled (default), '0' for disabled theme : # "light" (default), "dark", "dark_dimmed", "transparent_dark", "preferred_color_scheme" staticman: branch : # "master" From 0a7b730ee7e6d4b3743d132950b11ffc0d8ba8e9 Mon Sep 17 00:00:00 2001 From: Sean Killeen Date: Mon, 5 Jul 2021 15:56:30 -0400 Subject: [PATCH 21/21] docs wording fix --- docs/_docs/05-configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_docs/05-configuration.md b/docs/_docs/05-configuration.md index a08c334d0a5c..6e04524d213d 100644 --- a/docs/_docs/05-configuration.md +++ b/docs/_docs/05-configuration.md @@ -429,7 +429,7 @@ comments: To use giscus you will need to [install the app](https://github.com/apps/giscus) to your GitHub repository. -The next step is to go to and fill out the desired settings. This will generate a javascript, which will provide you with some of the settings you will need to configure things below. +The next step is to go to and fill out the desired settings. This will generate JavaScript that will provide you with the settings you will need to configure things below. You'll need to ensure you've added the following to `_config.yml`: