diff --git a/themes/butterfly/layout/includes/footer.pug b/themes/butterfly/layout/includes/footer.pug index 41e1e2b..4d2ae79 100644 --- a/themes/butterfly/layout/includes/footer.pug +++ b/themes/butterfly/layout/includes/footer.pug @@ -14,4 +14,4 @@ span= _p('footer.theme') + ' ' a(href='https://github.com/jerryc127/hexo-theme-butterfly')= 'Butterfly' if theme.footer.custom_text - .footer_custom_text!=`${theme.footer.custom_text}` \ No newline at end of file + .footer_custom_text!=`${theme.footer.custom_text}` diff --git a/themes/butterfly/layout/includes/third-party/comments/waline.pug b/themes/butterfly/layout/includes/third-party/comments/waline.pug index ae1a382..2407e4a 100644 --- a/themes/butterfly/layout/includes/third-party/comments/waline.pug +++ b/themes/butterfly/layout/includes/third-party/comments/waline.pug @@ -1,14 +1,17 @@ +- const { serverURL, avatar, avatarCDN, visitor, option } = theme.waline + script. function loadWaline () { function initWaline () { const waline = new Waline(Object.assign({ el: '#waline-wrap', - serverURL: '!{theme.waline.serverURL}', - avatar: '#{theme.waline.avatar}', + serverURL: '!{serverURL}', + avatar: '#{avatar}', + avatarCDN: '!{avatarCDN || "https://sdn.geekzu.org/avatar/"}', path: location.pathname, - visitor: #{theme.waline.visitor}, + visitor: !{visitor}, dark: 'html[data-theme="dark"]' - }, !{JSON.stringify(theme.waline.option)})) + }, !{JSON.stringify(option)})) } if (typeof Waline === 'function') initWaline() diff --git a/themes/butterfly/layout/includes/third-party/math/mathjax.pug b/themes/butterfly/layout/includes/third-party/math/mathjax.pug index f58689e..b784218 100644 --- a/themes/butterfly/layout/includes/third-party/math/mathjax.pug +++ b/themes/butterfly/layout/includes/third-party/math/mathjax.pug @@ -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] } } } diff --git a/themes/butterfly/package.json b/themes/butterfly/package.json index f6d9918..edd6bd6 100644 --- a/themes/butterfly/package.json +++ b/themes/butterfly/package.json @@ -1,6 +1,6 @@ { "name": "hexo-theme-butterfly", - "version": "3.8.0", + "version": "3.8.3", "description": "A Simple and Card UI Design theme for Hexo", "main": "package.json", "scripts": { diff --git a/themes/butterfly/source/css/_layout/head.styl b/themes/butterfly/source/css/_layout/head.styl index cefba44..bcd740a 100644 --- a/themes/butterfly/source/css/_layout/head.styl +++ b/themes/butterfly/source/css/_layout/head.styl @@ -9,7 +9,7 @@ // index &.full_page - min-height: $index_top_img_height + height: $index_top_img_height background-attachment: fixed #site-info @@ -70,7 +70,7 @@ // page &.not-home-page - min-height: 20rem + height: 20rem +maxWidth768() height: 14rem @@ -86,7 +86,7 @@ // post &.post-bg - min-height: 20rem + height: 20rem +maxWidth768() height: 18rem @@ -118,7 +118,7 @@ &.not-top-img margin-bottom: .5rem - min-height: 60px + height: 60px background: 0 #nav diff --git a/themes/butterfly/source/css/_layout/post.styl b/themes/butterfly/source/css/_layout/post.styl index 2f5c17d..2785ae1 100644 --- a/themes/butterfly/source/css/_layout/post.styl +++ b/themes/butterfly/source/css/_layout/post.styl @@ -231,18 +231,15 @@ no-beautify() padding: .5rem .8rem border: 1px solid var(--light-grey) transition: box-shadow .3s ease-in-out - overflow: hidden - border-radius: 12px !important - background-color: rgb(239 241 243) &:before + @extend .fontawesomeIcon position: absolute - right: -26px - top: -120px - content: '\f25e' - font-size: 200px - font-family: 'Font Awesome 5 Brands' - opacity: .2 + top: .1rem + right: .6rem + color: $theme-color + content: '\f1f9' + font-size: 1rem &:hover box-shadow: 0 0 8px 0 rgba(232, 237, 250, .6), 0 2px 4px 0 rgba(232, 237, 250, .5) @@ -256,14 +253,11 @@ no-beautify() padding-left: .3rem a - text-decoration: none + text-decoration: underline word-break: break-word &:hover text-decoration: none - - .post-copyright-cc-info - color: $theme-color; .post-outdate-notice position: relative diff --git a/themes/butterfly/source/css/_layout/third-party.styl b/themes/butterfly/source/css/_layout/third-party.styl index 8899d24..0d3fc08 100644 --- a/themes/butterfly/source/css/_layout/third-party.styl +++ b/themes/butterfly/source/css/_layout/third-party.styl @@ -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 diff --git a/themes/butterfly/source/css/_page/common.styl b/themes/butterfly/source/css/_page/common.styl index 4076804..c695216 100644 --- a/themes/butterfly/source/css/_page/common.styl +++ b/themes/butterfly/source/css/_page/common.styl @@ -1,7 +1,7 @@ #body-wrap display: flex flex-direction: column - height: 100vh + min-height: 100vh .layout display: flex diff --git a/themes/butterfly/source/css/var.styl b/themes/butterfly/source/css/var.styl index 6205406..87e1503 100644 --- a/themes/butterfly/source/css/var.styl +++ b/themes/butterfly/source/css/var.styl @@ -33,7 +33,7 @@ $font-color = #1F2D3D $rem = 20px $text-line-height = 2 $web-bg = hexo-config('background') && unquote(hexo-config('background')) -$index_top_img_height = hexo-config('index_top_img_height') ? convert(hexo-config('index_top_img_height')) : 100% +$index_top_img_height = hexo-config('index_top_img_height') ? convert(hexo-config('index_top_img_height')) : 100vh $index_site_info_top = hexo-config('index_site_info_top') ? convert(hexo-config('index_site_info_top')) : 43% // Global color & SVG $light-blue = $theme-color diff --git a/themes/butterfly/source/js/main.js b/themes/butterfly/source/js/main.js index 19f6644..4bf8839 100644 --- a/themes/butterfly/source/js/main.js +++ b/themes/butterfly/source/js/main.js @@ -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({ @@ -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')