diff options
author | Queensferry <queensferry.me@gmail.com> | 2022-04-01 12:27:40 +0300 |
---|---|---|
committer | Queensferry <queensferry.me@gmail.com> | 2022-04-01 12:27:40 +0300 |
commit | 5ff0ac6942e7eea55de937953209922d4347a1a6 (patch) | |
tree | 4adf3b96ebef71a6ae426c154d75eed1fd85e9db | |
parent | ba94670d3dc7580703f6f4c7d38965ae9923df5f (diff) |
feat: support giscus comment
-rw-r--r-- | config.toml | 16 | ||||
-rw-r--r-- | layouts/_default/single.html | 9 |
2 files changed, 16 insertions, 9 deletions
diff --git a/config.toml b/config.toml index 2ddbcdc..7db5176 100644 --- a/config.toml +++ b/config.toml @@ -71,6 +71,13 @@ enableHanEmph = true # use dots to emphasize chinese texts, see https://zh. since = "2019" # website created year toc = false # whether to enable table of contents in posts +# https://giscus.app +[params.giscus] +enable = true # whether to enable giscus +# paste giscus' <script></script> configuration between the triple quotes +script = """ +""" + [params.math] enable = true # whether to enable math typesetting use = "katex" # katex or mathjax @@ -83,8 +90,7 @@ warning = "⚠️ It has been <i>%d</i> days since the last update, the content # https://utteranc.es [params.utterances] -enable = false -repo = "" -issue_term = "pathname" -label = "Comment" -theme = "github-light" +enable = false # whether to enable utterances +# paste utterances' <script></script> configuration between the triple quotes +script = """ +""" diff --git a/layouts/_default/single.html b/layouts/_default/single.html index b4b496a..dbe21d2 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -54,12 +54,13 @@ <div class="comment"> <!-- disqus --> {{ template "_internal/disqus.html" . }} + <!-- giscus --> + {{ if .Site.Params.giscus.enable }} + {{ .Site.Params.giscus.script | safeHTML }} + {{ end }} <!-- utterances --> {{ if .Site.Params.utterances.enable }} - <script src="https://utteranc.es/client.js" repo="{{ .Site.Params.utterances.repo }}" - issue-term="{{ .Site.Params.utterances.issue_term }}" label="{{ .Site.Params.utterances.label }}" - theme="{{ .Site.Params.utterances.theme }}" crossorigin="anonymous" async> - </script> + {{ .Site.Params.utterances.script | safeHTML }} {{ end }} </div> {{ end }} |