Skip to content

Commit

Permalink
feat(add valine): add new comment plugin -- valine. Thanks to fi3ewor…
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework committed Jun 23, 2018
1 parent 13a1808 commit 8234a5f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ comment:
gitment_client_secret:
# Youyan site: http://www.uyan.cc/
youyan_uid:
# Valine site: https://valine.js.org/
valine_appId:
valine_appKey:
valine_placeHolder:

# ========== Analytics ========== #
# enable Busuanzi analytics
Expand Down
17 changes: 17 additions & 0 deletions layout/_partial/comment/valine.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<% if(theme.comment && theme.comment.valine_appId && theme.comment.valine_appKey) { %>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src='//unpkg.com/valine/dist/Valine.min.js'></script>
<div id="comment"></div>
<script>
new Valine({
el: '#comment' ,
notify:false,
verify:false,
appId: "<%- theme.comment.valine_appId %>",
appKey: "<%- theme.comment.valine_appKey %>",
placeholder: "<%- theme.comment.valine_placeHolder %>",
path:window.location.pathname,
avatar:'mm'
});
</script>
<% } %>
1 change: 1 addition & 0 deletions layout/post.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@
<%- partial('_partial/comment/changyan') %>
<%- partial('_partial/comment/youyan') %>
<%- partial('_partial/comment/custom') %>
<%- partial('_partial/comment/valine') %>
<!-- 评论 -->
</main>

0 comments on commit 8234a5f

Please sign in to comment.