1
0
Fork 0
This commit is contained in:
wwwatson 2023-09-13 12:33:45 +00:00 committed by GitHub
commit 20415a30f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 0 deletions
README.md
layouts/_default

View file

@ -63,6 +63,16 @@ disqusShortname = 'YOUR_DISQUS_SHORTNAME' # use disqus comments
gravatarCdn = 'GRAVATAR_CDN_LINK' # e.g. 'https://cdn.v2ex.com/gravatar/'
graphCommentId = "YOUR_GRAPH_COMMENT_ID" # use graph comment (disqus alternative)
math = true # enable KaTeX math typesetting globally
# giscus
[params.giscus]
repo = 'YOUR_GISCUS_REPO' # see https://giscus.app for more details
repoId = 'YOUR_GISCUS_REPO_ID'
category = 'YOUR__GISCUS_CATEGORY'
categoryId = 'YOUR_GISCUS_CATEGORY_ID'
mapping = 'pathname'
theme = 'light'
lang = 'zh-CN'
```
Available options to front matter:

View file

@ -100,6 +100,27 @@
})();
</script>
{{ end }}
<!-- giscus comment -->
{{ if and site.Params.giscus.repo (not (eq .Params.comments false)) }}
<div class="giscus mt-24"></div>
<script src="https://giscus.app/client.js"
data-repo="{{ site.Params.giscus.repo }}"
data-repo-id="{{ site.Params.giscus.repoId }}"
data-category="{{ site.Params.giscus.category }}"
data-category-id="{{ site.Params.giscus.categoryId }}"
data-mapping="{{ site.Params.giscus.mapping | default (print `pathname`) }}"
data-strict="{{ site.Params.giscus.strict | default (print `1`) }}"
data-reactions-enabled="{{ site.Params.giscus.reactionsEnabled | default (print `0`) }}"
data-emit-metadata="{{ site.Params.giscus.emitMetadata | default (print `0`) }}"
data-input-position="{{ site.Params.giscus.inputPosition | default (print `top`) }}"
data-theme="{{ site.Params.giscus.theme | default (print `light`) }}"
data-lang="{{ site.Params.giscus.lang | default (print `en`) }}"
data-loading="{{ site.Params.giscus.loading | default (print `lazy`) }}"
crossorigin="anonymous"
async>
</script>
{{ end }}
</article>
{{ end }}