Add giscus support (#3022)
* Add script in same style as utterances But adjusted for the various filed differences * Add initial script * Add default settings * Update changelog * Add feature to readme * Add comments html * add comment provider include * update config in docs * Add URL for additional reference * docs for giscus comments * Unrelated bugfix: add missing version separator So that things match the "history" doc. * add space * update history doc * update about doc * add to test config yaml * remove unnecessary / incorrect async attribute * probably should pass the right config paths * lowercase the repo name * 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. * update two additional docs * docs wording fix
This commit is contained in:
@@ -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 <https://giscus.app> 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`:
|
||||
|
||||
```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 : # '1' for enabled (default), '0' for disabled
|
||||
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.
|
||||
|
||||
@@ -24,6 +24,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
|
||||
|
||||
Reference in New Issue
Block a user