mirror of
https://github.com/tomfran/typo.git
synced 2025-04-27 22:19:56 +03:00
feat: add giscus support
This commit is contained in:
parent
d005e677d9
commit
ca11f2c2bb
3 changed files with 29 additions and 0 deletions
10
README.md
10
README.md
|
@ -193,6 +193,16 @@ url = "/posts"
|
|||
name = "resume"
|
||||
url = "/resume"
|
||||
|
||||
# giscus conf, for more detail, see https://giscus.app/
|
||||
[params.giscus]
|
||||
enable = true
|
||||
repo = ""
|
||||
repoid = ""
|
||||
category = ""
|
||||
categoryid = ""
|
||||
mapping = "pathname"
|
||||
theme = "light"
|
||||
|
||||
# Syntax highlight on code blocks, all styles:
|
||||
# https://xyproto.github.io/splash/docs/all.html
|
||||
# I suggest algol
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
|
||||
<div class="single-content">
|
||||
{{ .Content }}
|
||||
{{ partial "comments.html" . }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
18
layouts/partials/comments.html
Normal file
18
layouts/partials/comments.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
{{ if .Site.Params.giscus.enable }}
|
||||
<script src="https://giscus.app/client.js"
|
||||
data-repo="{{ .Site.Params.giscus.repo }}"
|
||||
data-repo-id="{{ .Site.Params.giscus.repoid }}"
|
||||
data-category="{{ .Site.Params.utteranc.category }}"
|
||||
data-category-id="{{ .Site.Params.giscus.categoryid }}"
|
||||
data-mapping="{{ .Site.Params.giscus.mapping }}"
|
||||
data-strict="0"
|
||||
data-reactions-enabled="1"
|
||||
data-emit-metadata="0"
|
||||
data-input-position="top"
|
||||
data-theme="{{ .Site.Params.giscus.theme }}"
|
||||
data-lang="en"
|
||||
data-loading="lazy"
|
||||
crossorigin="anonymous"
|
||||
async>
|
||||
</script>
|
||||
{{ end }}
|
Loading…
Add table
Add a link
Reference in a new issue