From e3763f07c1ecdca415558a9ad84b5862169d5d5b Mon Sep 17 00:00:00 2001 From: Cool-Y <1072916769@qq.com> Date: Sat, 10 Apr 2021 20:53:06 +0800 Subject: [PATCH] comment --- themes/next/_config.yml | 11 ++++++- themes/next/layout/_partials/comments.swig | 5 ++++ .../layout/_third-party/comments/gitalk.swig | 30 +++++++++++++++++++ .../layout/_third-party/comments/index.swig | 1 + 4 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 themes/next/layout/_third-party/comments/gitalk.swig diff --git a/themes/next/_config.yml b/themes/next/_config.yml index 74b5f25e..a5bb97de 100644 --- a/themes/next/_config.yml +++ b/themes/next/_config.yml @@ -408,7 +408,7 @@ valine: # Introduction: https://imsun.net/posts/gitment-introduction/ # You can get your Github ID from https://api.github.com/users/ gitment: - enable: true + enable: false mint: true # RECOMMEND, A mint on Gitment, to support count, language and proxy_gateway count: true # Show comments count in post meta area lazy: false # Comments lazy loading with a button @@ -421,6 +421,15 @@ gitment: proxy_gateway: # Address of api proxy, See: https://github.com/aimingoo/intersect redirect_protocol: # Protocol of redirect_uri with force_redirect_protocol when mint enabled +gitalk: + enable: true + github_user: Cool-Y + github_repo: gitment-comments + client_id: 180955a2c3ae3d966d9a + client_secret: 1c5db4da72df5e6fc318d12afe5f4406f7c54343 + admin: Cool-Y + distractionFreeMode: true + # Baidu Share # Available value: # button | slide diff --git a/themes/next/layout/_partials/comments.swig b/themes/next/layout/_partials/comments.swig index cee31144..86676221 100644 --- a/themes/next/layout/_partials/comments.swig +++ b/themes/next/layout/_partials/comments.swig @@ -62,6 +62,11 @@ {% endif %} + {% elseif theme.gitalk.enable %} +
+
+
+ {% elseif theme.valine.appid and theme.valine.appkey %}
diff --git a/themes/next/layout/_third-party/comments/gitalk.swig b/themes/next/layout/_third-party/comments/gitalk.swig new file mode 100644 index 00000000..8a01d219 --- /dev/null +++ b/themes/next/layout/_third-party/comments/gitalk.swig @@ -0,0 +1,30 @@ +{% if not (theme.duoshuo and theme.duoshuo.shortname) and not theme.duoshuo_shortname %} +{% if theme.gitalk.enable and theme.gitalk.client_id %} + + {% set CommentsClass = "Gitalk" %} + + + + + {% if page.comments %} + + {% endif %} + +{% endif %} +{% endif %} diff --git a/themes/next/layout/_third-party/comments/index.swig b/themes/next/layout/_third-party/comments/index.swig index b2da2320..8df7ca54 100644 --- a/themes/next/layout/_third-party/comments/index.swig +++ b/themes/next/layout/_third-party/comments/index.swig @@ -6,3 +6,4 @@ {% include 'changyan.swig' %} {% include 'gitment.swig' %} {% include 'valine.swig' %} +{% include 'gitalk.swig' %}