blog-186/themes/suka/layout/_plugin/comment/valine/main.ejs

32 lines
1.3 KiB
Plaintext

<div id="vcomments"></div>
<!--<script src="https://cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>-->
<script src="https://cdn.jsdelivr.net/npm/valine@latest/dist/Valine.min.js"></script>
<script>
var GUEST_INFO = ['nick', 'mail', 'link'];
var guest_info = '<%= theme.comment.valine.guest_info %>'.split(',').filter(function (item) {
return GUEST_INFO.indexOf(item) > -1
});
var notify = '<%= theme.comment.valine_notify %>' === 'true';
var verify = '<%= theme.comment.valine_verify %>' === 'true';
var valinedo = () => {
new Valine({
el: '#vcomments',
notify: notify,
verify: verify,
appId: "<%= theme.comment.valine.leancloud_appId %>",
appKey: "<%= theme.comment.valine.leancloud_appKey %>",
placeholder: "<%= theme.comment.valine.placeholder %>",
meta: guest_info,
pageSize: '<%= theme.comment.valine.pageSize %>',
avatar: '<%= theme.comment.valine.avatar %>',
lang: '<%= theme.comment.valine.lang %>',
guest_info: guest_info,
visitor: <%= theme.valine_counter.enable %>
});
};
valinestatus = true;
window.addEventListener('load',()=>{
valinedo();
});
</script>