mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 17:30:53 +08:00
2. Feature: 文章頁增加美化(原 melody主題功能),並增加更改標題前綴圖標和顔色 3. Feature: PC端增加直達評論按鈕 4. Feature: 可以對單獨文章設置是否顯示版權信息 5. Fix: 修復閲讀模式下,調整字體大小對代碼無效的bug 6. Fix: 調整Valine字體顯示問題 7. Fix: 修正夜間模式下Valine的適配問題 8. Fix: 修復Valine設置notify和verify無效的bug (thx @VincentTV ) 9. Remove: 去掉主題"閲讀更多"按鈕
26 lines
919 B
Plaintext
26 lines
919 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
|
|
});
|