Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add valine comment system
  • Loading branch information
xCss committed Oct 25, 2017
1 parent 543534b commit 82d2f4d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
10 changes: 10 additions & 0 deletions _config.sample.yml
Expand Up @@ -16,3 +16,13 @@ facebook:
duoshuo:
disqus:
gentie:
# Valine comments https://valine.js.org
valine:
enable: false # if you want use valine, please set enable: true
appid: # your leancloud appid
appkey: # your leancloud appkey
notify: false # true/false:mail notify !!!Test,Caution. 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: false # true/false:verify code
avatar: mm # avatar style https://github.com/xCss/Valine/wiki/avatar-setting-for-valine
placeholder: Just go go # comment box placeholder

17 changes: 17 additions & 0 deletions layout/partial/comments.jade
Expand Up @@ -53,3 +53,20 @@ if theme.youyan
document.getElementById('youyan_thread').appendChild(YYScript);

})();

if theme.valine.enable == true
a#comments
#vcomments(style="margin:0 30px;")
script(src='//cdn1.lncld.net/static/js/3.0.4/av-min.js')
script(src='//cdn.jsdelivr.net/gh/xcss/valine@v1.1.7/dist/Valine.min.js' + '?v=' + theme.version)
script.
var valine = new Valine({
el:'#vcomments',
notify:#{theme.valine.notify} || false,
verify:#{theme.valine.verify}|| false,
app_id:'#{theme.valine.appid}',
app_key:'#{theme.valine.appkey}',
placeholder:'#{theme.valine.placeholder}',
path: window.location.pathname,
avatar:'#{theme.valine.avatar}'
})
5 changes: 4 additions & 1 deletion package.json
Expand Up @@ -21,6 +21,9 @@
"url": "https://github.com/Ben02/hexo-theme-Anatole/issues"
},
"homepage": "https://github.com/Ben02/hexo-theme-Anatole#readme",
"devDependencies": {
"devDependencies": {},
"dependencies": {
"hexo-generator-archive": "^0.1.4",
"hexo-renderer-jade": "^0.4.1"
}
}

0 comments on commit 82d2f4d

Please sign in to comment.