add giscus comment

main
tink 2 years ago
parent bba67187e8
commit aeac84d2e6

@ -61,3 +61,23 @@ BookDateFormat = 'January 2, 2006'
# Portable links meant to work with text editors and let you write markdown without {{< relref >}} shortcode # Portable links meant to work with text editors and let you write markdown without {{< relref >}} shortcode
# Theme will print warning if page referenced in markdown does not exists. # Theme will print warning if page referenced in markdown does not exists.
BookPortableLinks = true BookPortableLinks = true
# 评论
# @see https://zhauniarovich.com/post/2021/2021-06-giscus/
[params.comments]
# Comment provider:
provider = "giscus"
# Which page types are commentable?
# commentable = {page = true, post = true, docs = false, project = false, publication = true, talk = false}
# Configuration of giscus
[params.comments.giscus]
repo = "cyub/go-1.14.13" # Repo where the comments will live
repo_id = "MDEwOlJlcG9zaXRvcnkzMzc2ODUyMzQ=" # Repo where the comments will live
category = "Announcements" # Repo where the comments will live
category_id = "DIC_kwDOFCCq8s4CZ3BC" # Repo where the comments will live
mapping = "pathname" # How Utterances will match comment to page
label = "comment" # Label applied to issue by utteranc.es bot
theme = "preferred_color_scheme" # What theme to use
reactions_enabled = 0

@ -0,0 +1,11 @@
<!-- This partial can be replaced to support other commenting engines -->
{{ if site.Params.comments.giscus }}
<script src="https://giscus.app/client.js" data-repo="{{site.Params.comments.giscus.repo}}"
data-repo-id="{{site.Params.comments.giscus.repo_id}}" data-category="{{site.Params.comments.giscus.category}}"
data-category-id="{{site.Params.comments.giscus.category_id}}"
data-mapping="{{site.Params.comments.giscus.mapping}}" data-strict="0" data-emit-metadata="0"
data-input-position="bottom" data-reactions-enabled="{{site.Params.comments.giscus.reactions_enabled}}"
data-lang="zh-CN" data-theme="{{site.Params.comments.giscus.theme}}" crossorigin="anonymous" async>
</script>
<noscript>Please enable JavaScript to view the comments powered by giscus.</noscript>
{{ end }}
Loading…
Cancel
Save