mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 20:30:53 +08:00
Compare commits
9 Commits
@@ -9,7 +9,7 @@
|
|||||||

|

|
||||||

|

|
||||||

|

|
||||||

|

|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||

|

|
||||||

|

|
||||||

|

|
||||||

|

|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|||||||
@@ -76,6 +76,10 @@
|
|||||||
if theme.twikoo.visitor
|
if theme.twikoo.visitor
|
||||||
+pvBlock('','','')
|
+pvBlock('','','')
|
||||||
span#twikoo_visitors
|
span#twikoo_visitors
|
||||||
|
default
|
||||||
|
if theme.busuanzi.page_pv
|
||||||
|
+pvBlock('','post-meta-pv-cv','')
|
||||||
|
span#busuanzi_value_page_pv
|
||||||
else if theme.busuanzi.page_pv
|
else if theme.busuanzi.page_pv
|
||||||
+pvBlock('','post-meta-pv-cv','')
|
+pvBlock('','post-meta-pv-cv','')
|
||||||
span#busuanzi_value_page_pv
|
span#busuanzi_value_page_pv
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ script.
|
|||||||
if (typeof twikoo === 'object') {
|
if (typeof twikoo === 'object') {
|
||||||
runTwikoo()
|
runTwikoo()
|
||||||
} else {
|
} else {
|
||||||
getScript('!{theme.asset.twikoo}').then(runTwikoo)
|
getScript('!{url_for(theme.asset.twikoo)}').then(runTwikoo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ script.
|
|||||||
el: '#vcomment',
|
el: '#vcomment',
|
||||||
appId: '#{theme.valine.appId}',
|
appId: '#{theme.valine.appId}',
|
||||||
appKey: '#{theme.valine.appKey}',
|
appKey: '#{theme.valine.appKey}',
|
||||||
|
serverURLs: '#{theme.valine.serverURLs}'
|
||||||
}
|
}
|
||||||
|
|
||||||
const valine = new Valine(initData)
|
const valine = new Valine(initData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,13 +15,15 @@ script.
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getCount = () => {
|
const getCount = () => {
|
||||||
|
const countELement = document.getElementById('twikoo-count')
|
||||||
|
if(!countELement) return
|
||||||
twikoo.getCommentsCount({
|
twikoo.getCommentsCount({
|
||||||
envId: '!{envId}',
|
envId: '!{envId}',
|
||||||
region: '!{region}',
|
region: '!{region}',
|
||||||
urls: [window.location.pathname],
|
urls: [window.location.pathname],
|
||||||
includeReply: false
|
includeReply: false
|
||||||
}).then(function (res) {
|
}).then(function (res) {
|
||||||
document.getElementById('twikoo-count').innerText = res[0].count
|
countELement.innerText = res[0].count
|
||||||
}).catch(function (err) {
|
}).catch(function (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
});
|
});
|
||||||
@@ -37,7 +39,7 @@ script.
|
|||||||
setTimeout(runFn,0)
|
setTimeout(runFn,0)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
getScript('!{theme.asset.twikoo}').then(runFn)
|
getScript('!{url_for(theme.asset.twikoo)}').then(runFn)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('!{use[0]}' === 'Twikoo' || !!{lazyload}) {
|
if ('!{use[0]}' === 'Twikoo' || !!{lazyload}) {
|
||||||
|
|||||||
4
layout/includes/third-party/math/katex.pug
vendored
4
layout/includes/third-party/math/katex.pug
vendored
@@ -1,6 +1,6 @@
|
|||||||
link(rel="stylesheet" type="text/css" href=theme.asset.katex)
|
link(rel="stylesheet" type="text/css" href=url_for(theme.asset.katex))
|
||||||
script(src=url_for(theme.asset.katex_copytex))
|
script(src=url_for(theme.asset.katex_copytex))
|
||||||
link(rel="stylesheet" type="text/css" href=theme.asset.katex_copytex_css)
|
link(rel="stylesheet" type="text/css" href=url_for(theme.asset.katex_copytex_css))
|
||||||
script.
|
script.
|
||||||
(() => {
|
(() => {
|
||||||
document.querySelectorAll('#article-container span.katex-display').forEach(item => {
|
document.querySelectorAll('#article-container span.katex-display').forEach(item => {
|
||||||
|
|||||||
2
layout/includes/third-party/math/mathjax.pug
vendored
2
layout/includes/third-party/math/mathjax.pug
vendored
@@ -37,7 +37,7 @@ script.
|
|||||||
}
|
}
|
||||||
|
|
||||||
const script = document.createElement('script')
|
const script = document.createElement('script')
|
||||||
script.src = '!{theme.asset.mathjax}'
|
script.src = '!{url_for(theme.asset.mathjax)}'
|
||||||
script.id = 'MathJax-script'
|
script.id = 'MathJax-script'
|
||||||
script.async = true
|
script.async = true
|
||||||
document.head.appendChild(script)
|
document.head.appendChild(script)
|
||||||
|
|||||||
2
layout/includes/third-party/math/mermaid.pug
vendored
2
layout/includes/third-party/math/mermaid.pug
vendored
@@ -18,7 +18,7 @@ script.
|
|||||||
}
|
}
|
||||||
|
|
||||||
const loadMermaid = () => {
|
const loadMermaid = () => {
|
||||||
window.loadMermaid ? runMermaid() : getScript('!{theme.asset.mermaid}').then(runMermaid)
|
window.loadMermaid ? runMermaid() : getScript('!{url_for(theme.asset.mermaid)}').then(runMermaid)
|
||||||
}
|
}
|
||||||
|
|
||||||
window.pjax ? loadMermaid() : document.addEventListener('DOMContentLoaded', loadMermaid)
|
window.pjax ? loadMermaid() : document.addEventListener('DOMContentLoaded', loadMermaid)
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ script.
|
|||||||
if (typeof twikoo === 'object') {
|
if (typeof twikoo === 'object') {
|
||||||
runTwikoo()
|
runTwikoo()
|
||||||
} else {
|
} else {
|
||||||
getScript('!{theme.asset.twikoo}').then(runTwikoo)
|
getScript('!{url_for(theme.asset.twikoo)}').then(runTwikoo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
layout/includes/third-party/pjax.pug
vendored
2
layout/includes/third-party/pjax.pug
vendored
@@ -3,7 +3,7 @@ if theme.pjax.exclude
|
|||||||
each val in theme.pjax.exclude
|
each val in theme.pjax.exclude
|
||||||
- pjaxExclude = pjaxExclude + `:not([href="${val}"])`
|
- pjaxExclude = pjaxExclude + `:not([href="${val}"])`
|
||||||
|
|
||||||
- let pjaxSelectors = ['title','#config-diff','#body-wrap','#rightside-config-hide','#rightside-config-show','.js-pjax']
|
- let pjaxSelectors = ['head > title','#config-diff','#body-wrap','#rightside-config-hide','#rightside-config-show','.js-pjax']
|
||||||
|
|
||||||
- let choose = theme.comments.use
|
- let choose = theme.comments.use
|
||||||
if choose
|
if choose
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hexo-theme-butterfly",
|
"name": "hexo-theme-butterfly",
|
||||||
"version": "4.2.0",
|
"version": "4.2.2",
|
||||||
"description": "A Simple and Card UI Design theme for Hexo",
|
"description": "A Simple and Card UI Design theme for Hexo",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ hexo.extend.filter.register('before_generate', () => {
|
|||||||
const data = path.join(hexo.plugin_dir,'hexo-butterfly-extjs/plugins.yml')
|
const data = path.join(hexo.plugin_dir,'hexo-butterfly-extjs/plugins.yml')
|
||||||
result = hexo.render.renderSync({ path: data, engine: 'yaml'})
|
result = hexo.render.renderSync({ path: data, engine: 'yaml'})
|
||||||
Object.keys(result).map(key => {
|
Object.keys(result).map(key => {
|
||||||
result[key] = 'pluginsSrc/' + result[key]
|
result[key] = '/pluginsSrc/' + result[key]
|
||||||
})
|
})
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
return result
|
return result
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ hexo.extend.filter.register('before_generate', () => {
|
|||||||
// Get first two digits of the Hexo version number
|
// Get first two digits of the Hexo version number
|
||||||
const hexoVer = hexo.version.replace(/(^.*\..*)\..*/, '$1')
|
const hexoVer = hexo.version.replace(/(^.*\..*)\..*/, '$1')
|
||||||
|
|
||||||
if (hexoVer < 5) {
|
if (hexoVer < 5.3) {
|
||||||
logger.error('Please update Hexo to V5.0.0 or higher!')
|
logger.error('Please update Hexo to V5.3.0 or higher!')
|
||||||
logger.error('請把 Hexo 升級到 V5.0.0 或更高的版本!')
|
logger.error('請把 Hexo 升級到 V5.3.0 或更高的版本!')
|
||||||
process.exit(-1)
|
process.exit(-1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
color: $search-color
|
color: $search-color
|
||||||
|
|
||||||
.search-result
|
.search-result
|
||||||
margin: 0 0 8px
|
margin: 0 8px 8px 0
|
||||||
word-break: break-all
|
word-break: break-all
|
||||||
|
|
||||||
.search-keyword
|
.search-keyword
|
||||||
|
|||||||
Reference in New Issue
Block a user