mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-10 21:17:07 +08:00
fix: 修復網站壓縮後,mermaid 會無法生成顯示的Bugs
feat: Valine 增加 option 設置
This commit is contained in:
10
layout/includes/third-party/comments/valine.pug
vendored
10
layout/includes/third-party/comments/valine.pug
vendored
@@ -1,3 +1,4 @@
|
||||
- let option = theme.valine.option ? JSON.stringify(theme.valine.option) : false
|
||||
- let emojiMaps = '""'
|
||||
if site.data.valine
|
||||
- emojiMaps = JSON.stringify(site.data.valine)
|
||||
@@ -5,7 +6,7 @@ if site.data.valine
|
||||
script.
|
||||
function loadValine () {
|
||||
function initValine () {
|
||||
const initData = {
|
||||
let initData = {
|
||||
el: '#vcomment',
|
||||
appId: '#{theme.valine.appId}',
|
||||
appKey: '#{theme.valine.appKey}',
|
||||
@@ -25,7 +26,12 @@ script.
|
||||
if (!{Boolean(theme.valine.requiredFields)}) {
|
||||
initData.requiredFields= ('!{theme.valine.requiredFields}'.split(','))
|
||||
}
|
||||
|
||||
|
||||
if (!{Boolean(option)}) {
|
||||
const otherData = !{option}
|
||||
initData = Object.assign({}, initData, otherData)
|
||||
}
|
||||
|
||||
const valine = new Valine(initData)
|
||||
}
|
||||
|
||||
|
||||
2
layout/includes/third-party/math/mathjax.pug
vendored
2
layout/includes/third-party/math/mathjax.pug
vendored
@@ -41,7 +41,7 @@ script.
|
||||
}
|
||||
}
|
||||
|
||||
var script = document.createElement('script')
|
||||
const script = document.createElement('script')
|
||||
script.src = '!{theme.CDN.mathjax}'
|
||||
script.id = 'MathJax-script'
|
||||
script.async = true
|
||||
|
||||
Reference in New Issue
Block a user