From 12dfd35bfe2ce37286aa1d4d4f657d995c77f940 Mon Sep 17 00:00:00 2001 From: nyms7 Date: Mon, 6 May 2024 15:19:49 +0800 Subject: [PATCH] feat: add giscus support --- README.md | 10 ++++++++++ layouts/_default/single.html | 1 + layouts/partials/comments.html | 18 ++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 layouts/partials/comments.html diff --git a/README.md b/README.md index c49d636..529116b 100644 --- a/README.md +++ b/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 diff --git a/layouts/_default/single.html b/layouts/_default/single.html index c0f41c5..420a8ba 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -43,6 +43,7 @@
{{ .Content }} + {{ partial "comments.html" . }}
diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html new file mode 100644 index 0000000..979b59e --- /dev/null +++ b/layouts/partials/comments.html @@ -0,0 +1,18 @@ +{{ if .Site.Params.giscus.enable }} + +{{ end }} \ No newline at end of file