mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-10 21:17:07 +08:00
2. Fix: valine lang not work 3. Fix: archives page site name not change when the language change 4. Fix: related posts url error
26 lines
923 B
Plaintext
26 lines
923 B
Plaintext
if theme.valine && theme.valine.enable
|
|
#vcomment.vcomment
|
|
script(src='https://cdn.jsdelivr.net/npm/valine/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}',
|
|
lang:'#{theme.valine.lang}',
|
|
recordIP: true
|
|
});
|