Skip to content

Commit 353ff6b

Browse files
Lete114zkqiang
authored andcommitted
sparkles 新增 discuss 评论插件
1 parent 28a3776 commit 353ff6b

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

_config.yml

+13-2
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ post:
723723
enable: false
724724
# 指定的插件,需要同时设置对应插件的必要参数
725725
# The specified plugin needs to set the necessary parameters at the same time
726-
# Options: utterances | disqus | gitalk | valine | waline | changyan | livere | remark42 | twikoo | cusdis | giscus
726+
# Options: utterances | disqus | gitalk | valine | waline | changyan | livere | remark42 | twikoo | cusdis | giscus | discuss
727727
type: disqus
728728

729729

@@ -877,6 +877,15 @@ giscus:
877877
input-position: top
878878
lang: zh-CN
879879

880+
# Discuss
881+
# 多平台、多数据库、自托管、免费开源评论系统
882+
# Self-hosted, small size, multi-platform, multi-database, free and open source commenting system
883+
# See: https://discuss.js.org
884+
discuss:
885+
serverURLs:
886+
path: window.location.pathname
887+
888+
880889
#---------------------------
881890
# 归档页
882891
# Archive Page
@@ -1027,7 +1036,7 @@ links:
10271036
enable: false
10281037
# 指定的插件,需要同时设置对应插件的必要参数
10291038
# The specified plugin needs to set the necessary parameters at the same time
1030-
# Options: utterances | disqus | gitalk | valine | waline | changyan | livere | remark42 | twikoo | cusdis | giscus
1039+
# Options: utterances | disqus | gitalk | valine | waline | changyan | livere | remark42 | twikoo | cusdis | giscus | discuss
10311040
type: disqus
10321041

10331042

@@ -1086,4 +1095,6 @@ static_prefix:
10861095

10871096
twikoo: https://lib.baomitu.com/twikoo/1.6.8/
10881097

1098+
discuss: https://lib.baomitu.com/discuss/1.2.1/
1099+
10891100
hint: https://lib.baomitu.com/hint.css/2.7.0/

layout/_partials/comments/discuss.ejs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<% if (theme.discuss && theme.discuss.serverURLs) { %>
2+
<div id="discuss-comments"></div>
3+
<script type="text/javascript">
4+
Fluid.utils.loadComments('#comments', function() {
5+
Fluid.utils.createScript('<%= url_join(theme.static_prefix.discuss, 'discuss.js') %>', function() {
6+
var options = Object.assign(
7+
<%- JSON.stringify(theme.discuss || {}) %>,
8+
{ el: '#discuss-comments',
9+
path: <%= theme.discuss.path %>
10+
}
11+
)
12+
discuss.init(options)
13+
});
14+
});
15+
</script>
16+
<noscript>Please enable JavaScript to view the comments</noscript>
17+
<% } %>

0 commit comments

Comments
 (0)