Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

Commit

Permalink
Add: add Valine comment system (#186)
Browse files Browse the repository at this point in the history
* Add: add Valine comment system

* update Valine version v1.1.7-rc3
  • Loading branch information
xCss authored and ppoffice committed Oct 19, 2017
1 parent e8833a0 commit 87ac098
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
7 changes: 7 additions & 0 deletions _config.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ comment:
appId: # enter the changyan appId here
appKey: # enter the changyan appKey here
on: # enter true to enable
valine: # Valine Comment System https://github.com/xCss/Valine
on: # enter true to enable valine
appId: # enter the leancloud application appId here
appKey: # enter the leancloud application appKey here
notify: # enter true to enable <Mail notifier> https://github.com/xCss/Valine/wiki/Valine-%E8%AF%84%E8%AE%BA%E7%B3%BB%E7%BB%9F%E4%B8%AD%E7%9A%84%E9%82%AE%E4%BB%B6%E6%8F%90%E9%86%92%E8%AE%BE%E7%BD%AE
verify: # enter true to enable <Validation code>
placeholder: Just Do It # enter the comment box placeholder

# Share
share: default # options: jiathis, bdshare, addtoany, default
Expand Down
2 changes: 2 additions & 0 deletions layout/comment/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<%- partial('comment/isso') %>
<% } else if (theme.comment.changyan.on) { %>
<%- partial('comment/changyan') %>
<% } else if (theme.comment.valine.on) { %>
<%- partial('comment/valine') %>
<% } %>
</section>
<% } %>
2 changes: 2 additions & 0 deletions layout/comment/scripts.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@
<%- partial('comment/isso', { script: true }) %>
<% } else if (theme.comment.changyan.on) { %>
<%- partial('comment/changyan', { script: true }) %>
<% } else if (theme.comment.valine.on) { %>
<%- partial('comment/valine', { script: true }) %>
<% } %>
16 changes: 16 additions & 0 deletions layout/comment/valine.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<% if (typeof(script) !== 'undefined' && script) { %>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src="//cdn.jsdelivr.net/gh/xcss/[email protected]/dist/Valine.min.js"></script>
<script>
new Valine({
el: '#valine-thread' ,
notify:<%= theme.comment.valine.notify %>,
verify:<%= theme.comment.valine.verify %>,
app_id: '<%= theme.comment.valine.appId %>',
app_key: '<%= theme.comment.valine.appKey %>',
placeholder: '<%= theme.comment.valine.placeholder %>'
});
</script>
<% } else { %>
<div id="valine-thread"></div>
<% } %>

0 comments on commit 87ac098

Please sign in to comment.