<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';
    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 %>
    });
</script>
