mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-10-04 06:22:00 +08:00
Merge branch 'dev'
This commit is contained in:
commit
097ea40a4a
11 files changed
+55
-24
No files matched your search
@@ -0,0 +1,13 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||||
|
patreon: # Replace with a single Patreon username
|
||||||
|
open_collective: # Replace with a single Open Collective username
|
||||||
|
ko_fi: # Replace with a single Ko-fi username
|
||||||
|
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||||
|
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||||
|
liberapay: # Replace with a single Liberapay username
|
||||||
|
issuehunt: # Replace with a single IssueHunt username
|
||||||
|
otechie: # Replace with a single Otechie username
|
||||||
|
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
||||||
|
custom: ['https://buy.stripe.com/3cs6rP6YA91sbbG5kk','https://jsd.012700.xyz/gh/jerryc127/CDN/Photo/wechat.jpg'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||||
+2
-1
@@ -266,6 +266,7 @@ aside:
|
|||||||
sort_order: # Don't modify the setting unless you know how it works
|
sort_order: # Don't modify the setting unless you know how it works
|
||||||
card_post_series:
|
card_post_series:
|
||||||
enable: true
|
enable: true
|
||||||
|
series_title: false # The title shows the series name
|
||||||
orderBy: 'date' # Order by title or date
|
orderBy: 'date' # Order by title or date
|
||||||
order: -1 # Sort of order. 1, asc for ascending; -1, desc for descending
|
order: -1 # Sort of order. 1, asc for ascending; -1, desc for descending
|
||||||
|
|
||||||
@@ -929,7 +930,7 @@ CDN:
|
|||||||
third_party_provider: jsdelivr
|
third_party_provider: jsdelivr
|
||||||
|
|
||||||
# Add version number to url, true or false
|
# Add version number to url, true or false
|
||||||
version: false
|
version: true
|
||||||
|
|
||||||
# Custom format
|
# Custom format
|
||||||
# For example: https://cdn.staticfile.org/${cdnjs_name}/${version}/${min_cdnjs_file}
|
# For example: https://cdn.staticfile.org/${cdnjs_name}/${version}/${min_cdnjs_file}
|
||||||
|
|||||||
+12
-8
@@ -3,8 +3,9 @@
|
|||||||
|
|
||||||
script.
|
script.
|
||||||
(() => {
|
(() => {
|
||||||
|
let artalkItem = null
|
||||||
const initArtalk = () => {
|
const initArtalk = () => {
|
||||||
window.artalkItem = new Artalk(Object.assign({
|
artalkItem = Artalk.init(Object.assign({
|
||||||
el: '#artalk-wrap',
|
el: '#artalk-wrap',
|
||||||
server: '!{server}',
|
server: '!{server}',
|
||||||
site: '!{site}',
|
site: '!{site}',
|
||||||
@@ -14,18 +15,22 @@ script.
|
|||||||
},!{JSON.stringify(option)}))
|
},!{JSON.stringify(option)}))
|
||||||
|
|
||||||
if (GLOBAL_CONFIG.lightbox === 'null') return
|
if (GLOBAL_CONFIG.lightbox === 'null') return
|
||||||
window.artalkItem.use(ctx => {
|
artalkItem.on('list-loaded', () => {
|
||||||
ctx.on('list-loaded', () => {
|
artalkItem.ctx.get('list').getCommentNodes().forEach(comment => {
|
||||||
ctx.getCommentList().forEach(comment => {
|
|
||||||
const $content = comment.getRender().$content
|
const $content = comment.getRender().$content
|
||||||
btf.loadLightbox($content.querySelectorAll('img:not([atk-emoticon])'))
|
btf.loadLightbox($content.querySelectorAll('img:not([atk-emoticon])'))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
|
const destroyArtalk = () => {
|
||||||
|
artalkItem.destroy()
|
||||||
|
}
|
||||||
|
|
||||||
|
btf.addGlobalFn('pjax', destroyArtalk, 'destroyArtalk')
|
||||||
}
|
}
|
||||||
|
|
||||||
const loadArtalk = async () => {
|
const loadArtalk = async () => {
|
||||||
if (typeof window.artalkItem === 'object') initArtalk()
|
if (typeof Artalk === 'object') initArtalk()
|
||||||
else {
|
else {
|
||||||
await getCSS('!{theme.asset.artalk_css}')
|
await getCSS('!{theme.asset.artalk_css}')
|
||||||
await getScript('!{theme.asset.artalk_js}')
|
await getScript('!{theme.asset.artalk_js}')
|
||||||
@@ -37,10 +42,9 @@ script.
|
|||||||
const artalkWrap = document.getElementById('artalk-wrap')
|
const artalkWrap = document.getElementById('artalk-wrap')
|
||||||
if (!(artalkWrap && artalkWrap.children.length)) return
|
if (!(artalkWrap && artalkWrap.children.length)) return
|
||||||
const isDark = theme === 'dark'
|
const isDark = theme === 'dark'
|
||||||
window.artalkItem.setDarkMode(isDark)
|
artalkItem.setDarkMode(isDark)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
btf.addGlobalFn('themeChange', artalkChangeMode, 'artalk')
|
btf.addGlobalFn('themeChange', artalkChangeMode, 'artalk')
|
||||||
|
|
||||||
if ('!{use[0]}' === 'Artalk' || !!{lazyload}) {
|
if ('!{use[0]}' === 'Artalk' || !!{lazyload}) {
|
||||||
|
|||||||
Loaded 3 of 11 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user