diff --git a/README.md b/README.md index b1f65411db..d082912cca 100644 --- a/README.md +++ b/README.md @@ -224,6 +224,31 @@ comments: label: # OPTIONAL: Adds an issue label in the issue ``` +#### Giscus + +[Giscus](https://giscus.app/) is another open source alternative linked to one's GitHub account. +It stores the comments as GitHub discussions on a repository for each page. + +Install the giscus [app](https://github.com/apps/giscus) to your repo. +After installing, add your info in the `_config.yml`: + +```yaml +comments: + giscus: # Enable by filling below information. For more info, go to https://giscus.app + repo: # Your public comments repository (e.g. owner/repo) + repo-id: # Your repo id, go to https://giscus.app to check it + category: # Category to search discussions. When removed, discussions will be searched in all categories + category-id: # Your category id, go to https://giscus.app to check it + mapping: # Discussion mapping + term: # OPTIONAL: some mappings require specific term, go to https://giscus.app to check it + strict: 1 # OPTIONAL: Avoid mismatches on similar titles + reactions-enabled: 0 # OPTIONAL: Disable reactions + emit-metadata: 1 # OPTIONAL: Emit discussion metadata + input-position: top # OPTIONAL: Place the comment box above the comments + theme: # OPTIONAL: Take the `color_theme` by default, or set a custom one like dark_dimmed + lang: # OPTIONAL: Choose the language. "en" is used by default +``` + ### Math typesetting with KateX When KateX is set in `_config.yml`: diff --git a/_config.yml b/_config.yml index bfd55a4246..e6885f8283 100644 --- a/_config.yml +++ b/_config.yml @@ -36,6 +36,12 @@ comments: utterances: # Enable by filling below information. For more info, go to https://utteranc.es repo: # your public comments repository (e.g. owner/repo) issue-term: # Issue term (e.g. "comment" consider issues with this word in the title as comments) + giscus: # Enable by filling below information. For more info, go to https://giscus.app + repo: # Your public comments repository (e.g. owner/repo) + repo-id: # Your repo id, go to https://giscus.app to check it + category: # Category to search discussions. When removed, discussions will be searched in all categories. + category-id: # Your category id, go to https://giscus.app to check it + mapping: # Discussion mapping # PAGINATION paginate: 5 diff --git a/_includes/blog/post_footer.liquid b/_includes/blog/post_footer.liquid index 67bb5d606a..dcbf150291 100644 --- a/_includes/blog/post_footer.liquid +++ b/_includes/blog/post_footer.liquid @@ -39,6 +39,11 @@ {% include blog/post_nav.liquid %} {% endif %} + + {% if site.comments.giscus.repo and site.comments.giscus.repo-id and site.comments.giscus.category-id and site.comments.giscus.mapping %} + {% include social/giscus.liquid %} + {% endif %} + {% if site.comments.utterances.repo and site.comments.utterances.issue-term %} {% include social/utterances.liquid %} diff --git a/_includes/social/giscus.liquid b/_includes/social/giscus.liquid new file mode 100644 index 0000000000..2cac36443f --- /dev/null +++ b/_includes/social/giscus.liquid @@ -0,0 +1,17 @@ +