mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2025-09-15 12:58:48 +08:00
update
This commit is contained in:
parent
f4d0687750
commit
4c9395666d
@ -788,7 +788,7 @@ fancybox: true
|
|||||||
# ---------------
|
# ---------------
|
||||||
abcjs:
|
abcjs:
|
||||||
enable: false
|
enable: false
|
||||||
per_page: false
|
per_page: true
|
||||||
|
|
||||||
# mermaid
|
# mermaid
|
||||||
# see https://github.com/mermaid-js/mermaid
|
# see https://github.com/mermaid-js/mermaid
|
||||||
@ -970,3 +970,4 @@ CDN:
|
|||||||
# artalk_js:
|
# artalk_js:
|
||||||
# artalk_css:
|
# artalk_css:
|
||||||
# busuanzi:
|
# busuanzi:
|
||||||
|
# abcjs_basic_js:
|
||||||
|
|||||||
@ -31,6 +31,8 @@ div
|
|||||||
|
|
||||||
include ./third-party/math/index.pug
|
include ./third-party/math/index.pug
|
||||||
|
|
||||||
|
include ./third-party/abcjs/index.pug
|
||||||
|
|
||||||
if commentsJsLoad
|
if commentsJsLoad
|
||||||
include ./third-party/comments/js.pug
|
include ./third-party/comments/js.pug
|
||||||
|
|
||||||
@ -60,11 +62,4 @@ div
|
|||||||
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
||||||
script(async data-pjax src= theme.asset.busuanzi || '//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js')
|
script(async data-pjax src= theme.asset.busuanzi || '//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js')
|
||||||
|
|
||||||
!=partial('includes/third-party/search/index', {}, {cache: true})
|
!=partial('includes/third-party/search/index', {}, {cache: true})
|
||||||
|
|
||||||
if theme.abcjs && theme.abcjs.enable
|
|
||||||
if theme.abcjs.per_page
|
|
||||||
if is_post() || is_page()
|
|
||||||
include ./third-party/abcjs.pug
|
|
||||||
else if page.abcjs
|
|
||||||
include ./third-party/abcjs.pug
|
|
||||||
18
layout/includes/third-party/abcjs.pug
vendored
18
layout/includes/third-party/abcjs.pug
vendored
@ -1,18 +0,0 @@
|
|||||||
script.
|
|
||||||
function abcjsInit() {
|
|
||||||
function abcjsFn() {
|
|
||||||
for (let abcContainer of document.getElementsByClassName("abc-music-sheet")) {
|
|
||||||
ABCJS.renderAbc(abcContainer, abcContainer.innerHTML, {responsive: 'resize'});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (typeof ABCJS === 'object') {
|
|
||||||
abcjsFn();
|
|
||||||
} else {
|
|
||||||
getScript('!{url_for(theme.asset.abcjs_basic_js)}')
|
|
||||||
.then(() => {
|
|
||||||
abcjsFn();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', abcjsInit);
|
|
||||||
15
layout/includes/third-party/abcjs/abcjs.pug
vendored
Normal file
15
layout/includes/third-party/abcjs/abcjs.pug
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
script.
|
||||||
|
(() => {
|
||||||
|
function abcjsInit() {
|
||||||
|
function abcjsFn() {
|
||||||
|
for (let abcContainer of document.getElementsByClassName("abc-music-sheet")) {
|
||||||
|
ABCJS.renderAbc(abcContainer, abcContainer.innerHTML, {responsive: 'resize'})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
typeof ABCJS === 'object' ? abcjsFn()
|
||||||
|
: getScript('!{url_for(theme.asset.abcjs_basic_js)}').then(abcjsFn)
|
||||||
|
}
|
||||||
|
|
||||||
|
window.pjax ? abcjsInit() : document.addEventListener('DOMContentLoaded', abcjsInit)
|
||||||
|
})()
|
||||||
6
layout/includes/third-party/abcjs/index.pug
vendored
Normal file
6
layout/includes/third-party/abcjs/index.pug
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
if theme.abcjs.enable
|
||||||
|
if theme.abcjs.per_page
|
||||||
|
if is_post() || is_page()
|
||||||
|
include ./abcjs.pug
|
||||||
|
else if page.abcjs
|
||||||
|
include ./abcjs.pug
|
||||||
@ -113,4 +113,12 @@ span.mathjax-overflow
|
|||||||
content: none
|
content: none
|
||||||
|
|
||||||
.snackbar-css
|
.snackbar-css
|
||||||
border-radius: 5px !important
|
border-radius: 5px !important
|
||||||
|
|
||||||
|
.abc-music-sheet
|
||||||
|
margin: 0 0 20px
|
||||||
|
opacity: 0
|
||||||
|
transition: opacity .3s
|
||||||
|
|
||||||
|
&.abcjs-container
|
||||||
|
opacity: 1
|
||||||
Loading…
Reference in New Issue
Block a user