From 26475d899bfd1cd7abdef35ecd2d77274064e0cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=A3=B8=E5=A5=94=E7=8B=82=E7=94=A9=E4=B8=81=E4=B8=81?=
<30397306+StreakingMan@users.noreply.github.com>
Date: Thu, 5 May 2022 23:36:54 +0800
Subject: [PATCH] feat: support utterances comment (#83)
---
_config.yml | 11 +++++
_includes/extensions/comments/utterances.html | 46 +++++++++++++++++++
_layouts/post.html | 4 ++
3 files changed, 61 insertions(+)
create mode 100644 _includes/extensions/comments/utterances.html
diff --git a/_config.yml b/_config.yml
index 9029b67..989eabb 100644
--- a/_config.yml
+++ b/_config.yml
@@ -194,6 +194,17 @@ yat:
# client_secret: "Your client secret"
# redirect_uri: "Your redirect url" # If you use a custom domain name
+# Utterances comments
+# See https://utteranc.es/
+# set follow_site_theme true to make utterances' theme follow the site's
+
+# utterances:
+# repo: "owner/repo"
+# issue_term: "title"
+# label: "utterances comment"
+# theme: "github-light"
+# follow_site_theme: true
+
# Build settings
# highlighter: none
markdown: kramdown
diff --git a/_includes/extensions/comments/utterances.html b/_includes/extensions/comments/utterances.html
new file mode 100644
index 0000000..4743562
--- /dev/null
+++ b/_includes/extensions/comments/utterances.html
@@ -0,0 +1,46 @@
+
+
+{%- if site.utterances.follow_site_theme -%}
+
+{%- endif -%}
diff --git a/_layouts/post.html b/_layouts/post.html
index d1680a2..c561308 100644
--- a/_layouts/post.html
+++ b/_layouts/post.html
@@ -69,6 +69,10 @@ sidebar:
{%- include extensions/comments/gitment.html -%}
{%- endif -%}
+ {%- if site.utterances.repo -%}
+ {%- include extensions/comments/utterances.html -%}
+ {%- endif -%}
+
{%- endif -%}
{%- endif -%}