Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryc127 committed Dec 29, 2023
2 parents bf14e66 + 6ebe51e commit 097ea40
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 27 deletions.
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -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']
3 changes: 2 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ aside:
sort_order: # Don't modify the setting unless you know how it works
card_post_series:
enable: true
series_title: false # The title shows the series name
orderBy: 'date' # Order by title or date
order: -1 # Sort of order. 1, asc for ascending; -1, desc for descending

Expand Down Expand Up @@ -929,7 +930,7 @@ CDN:
third_party_provider: jsdelivr

# Add version number to url, true or false
version: false
version: true

# Custom format
# For example: https://cdn.staticfile.org/${cdnjs_name}/${version}/${min_cdnjs_file}
Expand Down
26 changes: 15 additions & 11 deletions layout/includes/third-party/comments/artalk.pug
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

script.
(() => {
let artalkItem = null
const initArtalk = () => {
window.artalkItem = new Artalk(Object.assign({
artalkItem = Artalk.init(Object.assign({
el: '#artalk-wrap',
server: '!{server}',
site: '!{site}',
Expand All @@ -14,18 +15,22 @@ script.
},!{JSON.stringify(option)}))

if (GLOBAL_CONFIG.lightbox === 'null') return
window.artalkItem.use(ctx => {
ctx.on('list-loaded', () => {
ctx.getCommentList().forEach(comment => {
const $content = comment.getRender().$content
btf.loadLightbox($content.querySelectorAll('img:not([atk-emoticon])'))
})
artalkItem.on('list-loaded', () => {
artalkItem.ctx.get('list').getCommentNodes().forEach(comment => {
const $content = comment.getRender().$content
btf.loadLightbox($content.querySelectorAll('img:not([atk-emoticon])'))
})
})

const destroyArtalk = () => {
artalkItem.destroy()
}

btf.addGlobalFn('pjax', destroyArtalk, 'destroyArtalk')
}

const loadArtalk = async () => {
if (typeof window.artalkItem === 'object') initArtalk()
if (typeof Artalk === 'object') initArtalk()
else {
await getCSS('!{theme.asset.artalk_css}')
await getScript('!{theme.asset.artalk_js}')
Expand All @@ -37,12 +42,11 @@ script.
const artalkWrap = document.getElementById('artalk-wrap')
if (!(artalkWrap && artalkWrap.children.length)) return
const isDark = theme === 'dark'
window.artalkItem.setDarkMode(isDark)
artalkItem.setDarkMode(isDark)
}


btf.addGlobalFn('themeChange', artalkChangeMode, 'artalk')

if ('!{use[0]}' === 'Artalk' || !!{lazyload}) {
if (!{lazyload}) btf.loadComment(document.getElementById('artalk-wrap'), loadArtalk)
else loadArtalk()
Expand Down
7 changes: 7 additions & 0 deletions layout/includes/third-party/comments/waline.pug
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ script.
path: window.location.pathname,
comment: !{lazyload ? false : count},
}, !{JSON.stringify(option)}))

const destroyWaline = () => {
waline.destroy()
}

btf.addGlobalFn('pjax', destroyWaline, 'destroyWaline')

}

const loadWaline = async () => {
Expand Down
7 changes: 5 additions & 2 deletions layout/includes/third-party/newest-comments/github-issues.pug
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ script.
const findTrueUrl = (array) => {
Promise.all(array.map(item =>
fetch(item.url).then(resp => resp.json()).then(data => {
const urlArray = data.body.match(/(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?/ig)
let urlArray = data.body ? data.body.match(/(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?/ig) : []
if (!Array.isArray(urlArray) || urlArray.length === 0) {
urlArray = [`${data.html_url}`]
}
if (data.user.login === 'utterances-bot') {
return urlArray.pop()
} else {
Expand Down Expand Up @@ -48,7 +51,7 @@ script.
const githubArray = data.map(item => {
return {
'avatar': item.user.avatar_url,
'content': changeContent(item.body_html),
'content': changeContent(item.body_html || item.body),
'nick': item.user.login,
'url': item.issue_url,
'date': item.updated_at,
Expand Down
2 changes: 1 addition & 1 deletion layout/includes/widget/card_post_series.pug
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ if theme.aside.card_post_series.enable
.card-widget.card-post-series
.item-headline
i.fa-solid.fa-layer-group
span= _p('aside.card_post_series')
span= theme.aside.card_post_series.series_title ? page.series : _p('aside.card_post_series')
.aside-list
each item in array[page.series]
- const { path, title = _p('no_title'), cover, cover_type, date:dateA } = item
Expand Down
4 changes: 2 additions & 2 deletions layout/includes/widget/card_post_toc.pug
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- let tocNumber = page.toc_number !== undefined ? page.toc_number : theme.toc.number
- let tocExpand = page.toc_expand !== undefined ? page.toc_expand : theme.toc.expand
- let tocNumber = typeof page.toc_number === 'boolean' ? page.toc_number : theme.toc.number
- let tocExpand = typeof page.toc_expand === 'boolean' ? page.toc_expand : theme.toc.expand
- let tocExpandClass = tocExpand ? 'is-expand' : ''

#card-toc.card-widget
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hexo-theme-butterfly",
"version": "4.11.0",
"version": "4.12.0",
"description": "A Simple and Card UI Design theme for Hexo",
"main": "package.json",
"scripts": {
Expand Down
16 changes: 8 additions & 8 deletions plugins.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
algolia_search:
name: algoliasearch
file: dist/algoliasearch-lite.umd.js
version: 4.20.0
version: 4.22.0
instantsearch:
name: instantsearch.js
file: dist/instantsearch.production.min.js
version: 4.60.0
version: 4.63.0
pjax:
name: pjax
file: pjax.min.js
Expand Down Expand Up @@ -37,7 +37,7 @@ disqusjs_css:
twikoo:
name: twikoo
file: dist/twikoo.all.min.js
version: 1.6.25
version: 1.6.29
waline_js:
name: '@waline/client'
file: dist/waline.js
Expand Down Expand Up @@ -121,12 +121,12 @@ pangu:
fancybox_css:
name: '@fancyapps/ui'
file: dist/fancybox/fancybox.css
version: 5.0.28
version: 5.0.32
other_name: fancyapps-ui
fancybox:
name: '@fancyapps/ui'
file: dist/fancybox/fancybox.umd.js
version: 5.0.28
version: 5.0.32
other_name: fancyapps-ui
medium_zoom:
name: medium-zoom
Expand All @@ -144,7 +144,7 @@ fontawesome:
name: '@fortawesome/fontawesome-free'
file: css/all.min.css
other_name: font-awesome
version: 6.4.2
version: 6.5.1
flickr_justified_gallery_js:
name: flickr-justified-gallery
file: dist/fjGallery.min.js
Expand Down Expand Up @@ -188,11 +188,11 @@ prismjs_autoloader:
artalk_js:
name: artalk
file: dist/Artalk.js
version: 2.6.4
version: 2.7.3
artalk_css:
name: artalk
file: dist/Artalk.css
version: 2.6.4
version: 2.7.3
pace_js:
name: pace-js
other_name: pace
Expand Down
3 changes: 2 additions & 1 deletion scripts/events/merge_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ hexo.extend.filter.register('before_generate', () => {
},
card_post_series: {
enable: true,
series_title: false,
orderBy: 'date',
order: -1
}
Expand Down Expand Up @@ -534,7 +535,7 @@ hexo.extend.filter.register('before_generate', () => {
CDN: {
internal_provider: 'local',
third_party_provider: 'jsdelivr',
version: false,
version: true,
custom_format: null,
option: null
}
Expand Down
2 changes: 2 additions & 0 deletions source/css/_layout/post.styl
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ beautify()
h4,
h5,
h6
width: fit-content

a:not(.headerlink)
position relative
z-index 10
Expand Down

0 comments on commit 097ea40

Please sign in to comment.