天天看點

maupassant主題valine無法送出問題解決方法

maupassant 主題支援valine系統。至于valine怎麼申請就不詳說了。大緻申請appid,appkey,設定中添加安全域名。

 

 然後在主題的配置檔案中開啟即可。

 

 
 

 然而打開後發現評論無法送出。經過研究,發現是一個連結網址有錯誤。更新就可。

 

 
 

 comments.pug檔案

 

 
 

 if theme.valine.enable == true

 

      #vcomment

 

      script(src='//cdn1.lncld.net/static/js/3.0.4/av-min.js')

 
script(src='//cdn.jsdelivr.net/gh/xcss/[email protected]/dist/Valine.min.js')
 

      script.

 

        var notify = '#{ theme.valine.notify }' == true ? true : false;

 

        var verify = '#{ theme.valine.verify }' == true ? true : false;

 

        var GUEST_INFO = ['nick','mail','link'];

 

        var guest_info = '#{ theme.valine.guest_info }'.split(',').filter(function(item){

 

          return GUEST_INFO.indexOf(item) > -1

 

        });

 

        guest_info = guest_info.length == 0 ? GUEST_INFO :guest_info;

 

        window.valine = new Valine({

 

          el:'#vcomment',

 

          notify:notify,

 

          verify:verify,

 

          appId:'#{theme.valine.appid}',

 

          appKey:'#{theme.valine.appkey}',

 

          placeholder:'#{theme.valine.placeholder}',

 

          avatar:'#{theme.valine.avatar}',

 

          guest_info:guest_info,

 

          pageSize:'#{theme.valine.pageSize}'

 

        })