mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-10 21:17:07 +08:00
fix: 修復開啟 photofigcaption 後,導致 inlineImg 標籤外掛顯示錯亂的 bug close #667
fix: 修復使用本地搜索時,搜索插件配置為不搜索文章內容會無法使用搜索的 bug close #666 fix: 修復可能導致相關文章鏈接出錯的 bug close #549 improvement: 調整代碼框滾動條顏色 close #651 improvement: 當圖片沒有 figcaption 時,不會添加 figcaption 代碼
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hexo-theme-butterfly",
|
||||
"version": "3.8.3",
|
||||
"version": "3.8.4",
|
||||
"description": "A Simple and Card UI Design theme for Hexo",
|
||||
"main": "package.json",
|
||||
"scripts": {
|
||||
@@ -20,7 +20,7 @@
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jerryc127/hexo-theme-butterfly/issues",
|
||||
"email": "btf@immyw.com"
|
||||
"email": "i@immyw.com"
|
||||
},
|
||||
"dependencies": {
|
||||
"hexo-renderer-stylus": "^2.0.1",
|
||||
|
||||
@@ -46,11 +46,7 @@ hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
|
||||
|
||||
if (relatedPosts.length > 0) {
|
||||
result += '<div class="relatedPosts">'
|
||||
result +=
|
||||
'<div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>' +
|
||||
' ' +
|
||||
headlineLang +
|
||||
'</span></div>'
|
||||
result += `<div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>${headlineLang}</span></div>`
|
||||
result += '<div class="relatedPosts-list">'
|
||||
|
||||
for (let i = 0; i < Math.min(relatedPosts.length, limitNum); i++) {
|
||||
@@ -58,32 +54,14 @@ hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
|
||||
relatedPosts[i].cover === false
|
||||
? relatedPosts[i].randomcover
|
||||
: relatedPosts[i].cover
|
||||
result +=
|
||||
'<div><a href="' +
|
||||
hexoConfig.root +
|
||||
relatedPosts[i].path +
|
||||
'" title="' +
|
||||
relatedPosts[i].title +
|
||||
'">'
|
||||
result +=
|
||||
'<img class="cover" src="' +
|
||||
this.url_for(cover) +
|
||||
'" alt="cover">'
|
||||
result += `<div><a href="${this.url_for(relatedPosts[i].path)}" title="${relatedPosts[i].title}">`
|
||||
result += `<img class="cover" src="${this.url_for(cover)}" alt="cover">`
|
||||
if (dateType === 'created') {
|
||||
result +=
|
||||
'<div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i>' +
|
||||
' ' +
|
||||
this.date(relatedPosts[i].created, hexoConfig.date_format) +
|
||||
'</div>'
|
||||
result += `<div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> ${this.date(relatedPosts[i].created, hexoConfig.date_format)}</div>`
|
||||
} else {
|
||||
result +=
|
||||
'<div class="content is-center"><div class="date"><i class="fas fa-history fa-fw"></i>' +
|
||||
' ' +
|
||||
this.date(relatedPosts[i].updated, hexoConfig.date_format) +
|
||||
'</div>'
|
||||
result += `<div class="content is-center"><div class="date"><i class="fas fa-history fa-fw"></i> ${this.date(relatedPosts[i].updated, hexoConfig.date_format)}</div>`
|
||||
}
|
||||
result +=
|
||||
'<div class="title">' + relatedPosts[i].title + '</div>'
|
||||
result += `<div class="title">${relatedPosts[i].title}</div>`
|
||||
result += '</div></a></div>'
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ if $highlight_theme == 'darker' || ($highlight_theme == 'mac')
|
||||
color: alpha($highlight-foreground, .8),
|
||||
bg-color: darken($highlight-background, 2)
|
||||
}
|
||||
$highlight-scrollbar = darken($highlight-background, 6)
|
||||
$highlight-scrollbar = lighten($highlight-background, 8)
|
||||
|
||||
if $highlighEnable
|
||||
$highlight-comment = #969896
|
||||
@@ -37,7 +37,7 @@ if $highlight_theme == 'pale night'
|
||||
color: $highlight-foreground,
|
||||
bg-color: darken($highlight-background, 2)
|
||||
}
|
||||
$highlight-scrollbar = darken($highlight-background, 6)
|
||||
$highlight-scrollbar = lighten($highlight-background, 8)
|
||||
|
||||
if $highlighEnable
|
||||
$highlight-comment = #676E95
|
||||
@@ -63,7 +63,7 @@ if $highlight_theme == 'ocean'
|
||||
color: $highlight-foreground,
|
||||
bg-color: darken($highlight-background, 2)
|
||||
}
|
||||
$highlight-scrollbar = darken($highlight-background, 5)
|
||||
$highlight-scrollbar = lighten($highlight-background, 8)
|
||||
|
||||
if $highlighEnable
|
||||
$highlight-comment = rgba(101, 115, 126, .8)
|
||||
|
||||
@@ -225,10 +225,11 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
function addPhotoFigcaption () {
|
||||
document.querySelectorAll('#article-container img').forEach(function (item) {
|
||||
const parentEle = item.parentNode
|
||||
if (!parentEle.parentNode.classList.contains('justified-gallery')) {
|
||||
const altValue = item.alt
|
||||
if (altValue && !parentEle.parentNode.classList.contains('justified-gallery')) {
|
||||
const ele = document.createElement('div')
|
||||
ele.className = 'img-alt is-center'
|
||||
ele.textContent = item.getAttribute('alt')
|
||||
ele.textContent = altValue
|
||||
parentEle.insertBefore(ele, item.nextSibling)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -47,9 +47,10 @@ window.addEventListener('load', () => {
|
||||
.then(str => new window.DOMParser().parseFromString(str, 'text/xml'))
|
||||
.then(data => {
|
||||
const datas = [...data.querySelectorAll('entry')].map(function (item) {
|
||||
const content = item.querySelector('content')
|
||||
return {
|
||||
title: item.querySelector('title').textContent,
|
||||
content: item.querySelector('content').textContent,
|
||||
content: content ? content.textContent : '',
|
||||
url: item.querySelector('url').textContent
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user