Skip to content

Commit

Permalink
Update Hexo Theme Butterfly DEV
Browse files Browse the repository at this point in the history
  • Loading branch information
CCKNBC committed Nov 20, 2024
2 parents 0c084d1 + 95ca687 commit 17b3250
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 37 deletions.
39 changes: 14 additions & 25 deletions layout/includes/header/post-info.pug
Original file line number Diff line number Diff line change
Expand Up @@ -60,49 +60,38 @@
if block
block

- const commentUse = comments && comments.use && comments.use[0]
if page.comments !== false && commentUse && !comments.lazyload
- let handled = false
mixin otherPV()
if theme.umami_analytics.enable && theme.umami_analytics.UV_PV.page_pv
+pvBlock('', '', '')
span#umamiPV(data-path=url_for(page.path))
i.fa-solid.fa-spinner.fa-spin
else if theme.busuanzi.page_pv
+pvBlock('', 'post-meta-pv-cv', '')
span#busuanzi_value_page_pv
i.fa-solid.fa-spinner.fa-spin

- const commentUse = comments.use && comments.use[0]
if page.comments !== false && commentUse && !comments.lazyload
if commentUse === 'Valine' && theme.valine.visitor
+pvBlock(url_for(page.path), 'leancloud_visitors', page.title)
span.leancloud-visitors-count
i.fa-solid.fa-spinner.fa-spin
- handled = true
else if commentUse === 'Waline' && theme.waline.pageview
+pvBlock('', '', '')
span.waline-pageview-count(data-path=url_for(page.path))
i.fa-solid.fa-spinner.fa-spin
- handled = true
else if commentUse === 'Twikoo' && theme.twikoo.visitor
+pvBlock('', '', '')
span#twikoo_visitors
i.fa-solid.fa-spinner.fa-spin
- handled = true
else if commentUse === 'Artalk' && theme.artalk.visitor
+pvBlock('', '', '')
span#ArtalkPV
i.fa-solid.fa-spinner.fa-spin
- handled = true

if !handled
if theme.umami_analytics.enable && theme.umami_analytics.UV_PV.page_pv
+pvBlock('', '', '')
span#umamiPV(data-path=url_for(page.path))
i.fa-solid.fa-spinner.fa-spin
else if theme.busuanzi.page_pv
+pvBlock('', 'post-meta-pv-cv', '')
span#busuanzi_value_page_pv
i.fa-solid.fa-spinner.fa-spin
else
+otherPV()
else
if theme.umami_analytics.enable && theme.umami_analytics.UV_PV.page_pv
+pvBlock('', '', '')
span#umamiPV(data-path=url_for(page.path))
i.fa-solid.fa-spinner.fa-spin
else if theme.busuanzi.page_pv
+pvBlock('', 'post-meta-pv-cv', '')
span#busuanzi_value_page_pv
i.fa-solid.fa-spinner.fa-spin
+otherPV()

if comments.count && !comments.lazyload && page.comments !== false && comments.use
- var whichCount = comments.use[0]
Expand Down
16 changes: 10 additions & 6 deletions layout/includes/page/shuoshuo.pug
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@
${item.content}
</div>
<div class="shuoshuo-footer">
<div class="shuoshuo-tags">
${item.tags.map(tag => `<span class="shuoshuo-tag">${tag}</span>`).join('')}
</div>
${item.tags && item.tags.length ? `
<div class="shuoshuo-footer">
<div class="shuoshuo-tags">
${item.tags.map(tag => `<span class="shuoshuo-tag">${tag}</span>`).join('')}
</div>
</div>` : ''}
</div>
</div>
`
Expand Down Expand Up @@ -98,6 +101,7 @@
.shuoshuo-content
!=markdown(i.content)
.shuoshuo-footer
.shuoshuo-tags
each tag in i.tags
span.shuoshuo-tag=tag
if i.tags
.shuoshuo-tags
each tag in i.tags
span.shuoshuo-tag=tag
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": "5.0.0",
"version": "5.1.0-b1",
"description": "A Simple and Card UI Design theme for Hexo",
"main": "package.json",
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ activate_power_mode:
version: 1.1.4
algolia_search:
name: algoliasearch
file: dist/algoliasearch-lite.umd.js
version: 5.7.0
file: dist/lite/builds/browser.umd.js
version: 5.8.1
aplayer_css:
name: aplayer
file: dist/APlayer.min.css
Expand Down Expand Up @@ -111,7 +111,7 @@ instantpage:
instantsearch:
name: instantsearch.js
file: dist/instantsearch.production.min.js
version: 4.74.2
version: 4.75.0
katex:
name: katex
file: dist/katex.min.css
Expand All @@ -137,7 +137,7 @@ medium_zoom:
mermaid:
name: mermaid
file: dist/mermaid.min.js
version: 11.2.1
version: 11.3.0
meting_js:
name: butterfly-extsrc
file: metingjs/dist/Meting.min.js
Expand Down
1 change: 1 addition & 0 deletions source/css/_search/algolia.styl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
height: 24px
text-align: center
line-height: 24px
addBorderRadius()

.ais-Pagination-item--selected
a
Expand Down
3 changes: 2 additions & 1 deletion source/js/search/algolia.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ window.addEventListener('load', () => {
document.querySelector('#algolia-info .algolia-stats')
]

const searchClient = typeof algoliasearch === 'function' ? algoliasearch : window['algoliasearch/lite'].liteClient
const search = instantsearch({
indexName,
searchClient: algoliasearch(appId, apiKey),
searchClient: searchClient(appId, apiKey),
searchFunction (helper) {
disableDiv.forEach(item => {
item.style.display = helper.state.query ? '' : 'none'
Expand Down

0 comments on commit 17b3250

Please sign in to comment.