${this.date(relatedPosts[i].created, hexoConfig.date_format)}
`
} else {
- result +=
- '
' +
- ' ' +
- this.date(relatedPosts[i].updated, hexoConfig.date_format) +
- '
'
+ result += `
${this.date(relatedPosts[i].updated, hexoConfig.date_format)}
`
}
- result +=
- '
' + relatedPosts[i].title + '
'
+ result += `
${relatedPosts[i].title}
`
result += '
'
}
diff --git a/source/css/_highlight/theme.styl b/source/css/_highlight/theme.styl
index 528f18e..58fc330 100644
--- a/source/css/_highlight/theme.styl
+++ b/source/css/_highlight/theme.styl
@@ -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)
diff --git a/source/js/main.js b/source/js/main.js
index 4bf8839..41a21e4 100644
--- a/source/js/main.js
+++ b/source/js/main.js
@@ -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)
}
})
diff --git a/source/js/search/local-search.js b/source/js/search/local-search.js
index 1abc7cf..5b13445 100644
--- a/source/js/search/local-search.js
+++ b/source/js/search/local-search.js
@@ -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
}
})