Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryc127 committed Jul 10, 2021
2 parents 7b520c6 + bbb9beb commit 42bc175
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
12 changes: 11 additions & 1 deletion layout/includes/third-party/math/mathjax.pug
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,17 @@ script.
math.end = {node: text, delim: '', n: 0}
doc.math.push(math)
}
}, '']
}, ''],
insertScript: [200, () => {
document.querySelectorAll('mjx-container:not\([display]\)').forEach(node => {
const target = node.parentNode
if (target.nodeName.toLowerCase() === 'li') {
target.parentNode.classList.add('has-jax')
} else {
target.classList.add('has-jax')
}
});
}, '', false]
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hexo-theme-butterfly",
"version": "3.8.0",
"version": "3.8.1",
"description": "A Simple and Card UI Design theme for Hexo",
"main": "package.json",
"scripts": {
Expand All @@ -24,7 +24,7 @@
},
"dependencies": {
"hexo-renderer-stylus": "^2.0.1",
"hexo-renderer-pug": "^1.0.0"
"hexo-renderer-pug": "^2.0.0"
},
"homepage": "https://butterfly.js.org/",
"author": "Jerry <[email protected]>",
Expand Down
7 changes: 2 additions & 5 deletions source/css/_layout/third-party.styl
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,11 @@ if hexo-config('waline.bg')
display: none

// mathjax
mjx-container
mjx-container[display],
.has-jax
overflow-x: auto
overflow-y: hidden

&:not([display])
display: inline-grid
max-width: 100%

.aplayer
color: $font-black

Expand Down
4 changes: 2 additions & 2 deletions source/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ document.addEventListener('DOMContentLoaded', function () {
}

const addMediumZoom = () => {
const zoom = mediumZoom(document.querySelectorAll('#article-container :not(a)>img'))
const zoom = mediumZoom(document.querySelectorAll('#article-container :not(a):not(.flink-item-icon) > img'))
zoom.on('open', e => {
const photoBg = document.documentElement.getAttribute('data-theme') === 'dark' ? '#121212' : '#fff'
zoom.update({
Expand All @@ -305,7 +305,7 @@ document.addEventListener('DOMContentLoaded', function () {

const jqLoadAndRun = () => {
const $fancyboxEle = GLOBAL_CONFIG.lightbox === 'fancybox'
? document.querySelectorAll('#article-container :not(a):not(.gallery-group) > img, #article-container > img')
? document.querySelectorAll('#article-container :not(a):not(.gallery-group):not(.flink-item-icon) > img, #article-container > img')
: []
const fbLengthNoZero = $fancyboxEle.length > 0
const $jgEle = document.querySelectorAll('#article-container .justified-gallery')
Expand Down

0 comments on commit 42bc175

Please sign in to comment.