Skip to content

Commit

Permalink
fix: 修復首頁文章 valine 評論數只顯示第一篇的 bug
Browse files Browse the repository at this point in the history
fix: 修復子目錄下,第三方插件本地資源無法加載的 bug closed #908
fix: 評論系統開啟時 busuanzi 的 page_pv 不顯示的 bug closed #902
fix: 修復 pjax 下,使用 mermaid 跳轉會重新加載的 bug
  • Loading branch information
jerryc127 committed May 19, 2022
1 parent 004a27d commit 6e58f68
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 10 deletions.
4 changes: 4 additions & 0 deletions layout/includes/header/post-info.pug
Expand Up @@ -76,6 +76,10 @@
if theme.twikoo.visitor
+pvBlock('','','')
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
+pvBlock('','post-meta-pv-cv','')
span#busuanzi_value_page_pv
Expand Down
2 changes: 1 addition & 1 deletion layout/includes/third-party/card-post-count/twikoo.pug
Expand Up @@ -28,7 +28,7 @@ script.
if (typeof twikoo === 'object') {
runTwikoo()
} else {
getScript('!{theme.asset.twikoo}').then(runTwikoo)
getScript('!{url_for(theme.asset.twikoo)}').then(runTwikoo)
}
}

Expand Down
2 changes: 1 addition & 1 deletion layout/includes/third-party/card-post-count/valine.pug
Expand Up @@ -6,8 +6,8 @@ script.
el: '#vcomment',
appId: '#{theme.valine.appId}',
appKey: '#{theme.valine.appKey}',
serverURLs: '#{theme.valine.serverURLs}'
}

const valine = new Valine(initData)
}

Expand Down
2 changes: 1 addition & 1 deletion layout/includes/third-party/comments/twikoo.pug
Expand Up @@ -39,7 +39,7 @@ script.
setTimeout(runFn,0)
return
}
getScript('!{theme.asset.twikoo}').then(runFn)
getScript('!{url_for(theme.asset.twikoo)}').then(runFn)
}

if ('!{use[0]}' === 'Twikoo' || !!{lazyload}) {
Expand Down
4 changes: 2 additions & 2 deletions layout/includes/third-party/math/katex.pug
@@ -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))
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.
(() => {
document.querySelectorAll('#article-container span.katex-display').forEach(item => {
Expand Down
2 changes: 1 addition & 1 deletion layout/includes/third-party/math/mathjax.pug
Expand Up @@ -37,7 +37,7 @@ script.
}

const script = document.createElement('script')
script.src = '!{theme.asset.mathjax}'
script.src = '!{url_for(theme.asset.mathjax)}'
script.id = 'MathJax-script'
script.async = true
document.head.appendChild(script)
Expand Down
2 changes: 1 addition & 1 deletion layout/includes/third-party/math/mermaid.pug
Expand Up @@ -18,7 +18,7 @@ script.
}

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)
Expand Down
Expand Up @@ -43,7 +43,7 @@ script.
if (typeof twikoo === 'object') {
runTwikoo()
} else {
getScript('!{theme.asset.twikoo}').then(runTwikoo)
getScript('!{url_for(theme.asset.twikoo)}').then(runTwikoo)
}
}

Expand Down
2 changes: 1 addition & 1 deletion layout/includes/third-party/pjax.pug
Expand Up @@ -3,7 +3,7 @@ if theme.pjax.exclude
each val in theme.pjax.exclude
- 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
if choose
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "hexo-theme-butterfly",
"version": "4.2.1",
"version": "4.2.2",
"description": "A Simple and Card UI Design theme for Hexo",
"main": "package.json",
"scripts": {
Expand Down

0 comments on commit 6e58f68

Please sign in to comment.