Compare commits

...

53 Commits
4.2.1 ... 3.8.4

10 changed files with 31 additions and 48 deletions

View File

@@ -461,9 +461,9 @@ google_adsense:
# -------------------------------------- # --------------------------------------
site_verification: site_verification:
# - name: google_site_verification # - name: google-site-verification
# content: xxxxxx # content: xxxxxx
# - name: baidu_site_verification # - name: baidu-site-verification
# content: xxxxxxx # content: xxxxxxx
# Beautify/Effect (美化/效果) # Beautify/Effect (美化/效果)

View File

@@ -1,14 +1,17 @@
- const { serverURL, avatar, avatarCDN, visitor, option } = theme.waline
script. script.
function loadWaline () { function loadWaline () {
function initWaline () { function initWaline () {
const waline = new Waline(Object.assign({ const waline = new Waline(Object.assign({
el: '#waline-wrap', el: '#waline-wrap',
serverURL: '!{theme.waline.serverURL}', serverURL: '!{serverURL}',
avatar: '#{theme.waline.avatar}', avatar: '#{avatar}',
avatarCDN: '!{avatarCDN || "https://sdn.geekzu.org/avatar/"}',
path: location.pathname, path: location.pathname,
visitor: #{theme.waline.visitor}, visitor: !{visitor},
dark: 'html[data-theme="dark"]' dark: 'html[data-theme="dark"]'
}, !{JSON.stringify(theme.waline.option)})) }, !{JSON.stringify(option)}))
} }
if (typeof Waline === 'function') initWaline() if (typeof Waline === 'function') initWaline()

View File

@@ -1,6 +1,6 @@
{ {
"name": "hexo-theme-butterfly", "name": "hexo-theme-butterfly",
"version": "3.8.1", "version": "3.8.4",
"description": "A Simple and Card UI Design theme for Hexo", "description": "A Simple and Card UI Design theme for Hexo",
"main": "package.json", "main": "package.json",
"scripts": { "scripts": {
@@ -20,7 +20,7 @@
}, },
"bugs": { "bugs": {
"url": "https://github.com/jerryc127/hexo-theme-butterfly/issues", "url": "https://github.com/jerryc127/hexo-theme-butterfly/issues",
"email": "btf@immyw.com" "email": "i@immyw.com"
}, },
"dependencies": { "dependencies": {
"hexo-renderer-stylus": "^2.0.1", "hexo-renderer-stylus": "^2.0.1",

View File

@@ -46,11 +46,7 @@ hexo.extend.helper.register('related_posts', function (currentPost, allPosts) {
if (relatedPosts.length > 0) { if (relatedPosts.length > 0) {
result += '<div class="relatedPosts">' result += '<div class="relatedPosts">'
result += result += `<div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>${headlineLang}</span></div>`
'<div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>' +
' ' +
headlineLang +
'</span></div>'
result += '<div class="relatedPosts-list">' result += '<div class="relatedPosts-list">'
for (let i = 0; i < Math.min(relatedPosts.length, limitNum); i++) { 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].cover === false
? relatedPosts[i].randomcover ? relatedPosts[i].randomcover
: relatedPosts[i].cover : relatedPosts[i].cover
result += result += `<div><a href="${this.url_for(relatedPosts[i].path)}" title="${relatedPosts[i].title}">`
'<div><a href="' + result += `<img class="cover" src="${this.url_for(cover)}" alt="cover">`
hexoConfig.root +
relatedPosts[i].path +
'" title="' +
relatedPosts[i].title +
'">'
result +=
'<img class="cover" src="' +
this.url_for(cover) +
'" alt="cover">'
if (dateType === 'created') { if (dateType === 'created') {
result += 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>`
'<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 { } else {
result += 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>`
'<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 += result += `<div class="title">${relatedPosts[i].title}</div>`
'<div class="title">' + relatedPosts[i].title + '</div>'
result += '</div></a></div>' result += '</div></a></div>'
} }

View File

@@ -11,7 +11,7 @@ if $highlight_theme == 'darker' || ($highlight_theme == 'mac')
color: alpha($highlight-foreground, .8), color: alpha($highlight-foreground, .8),
bg-color: darken($highlight-background, 2) bg-color: darken($highlight-background, 2)
} }
$highlight-scrollbar = darken($highlight-background, 6) $highlight-scrollbar = lighten($highlight-background, 8)
if $highlighEnable if $highlighEnable
$highlight-comment = #969896 $highlight-comment = #969896
@@ -37,7 +37,7 @@ if $highlight_theme == 'pale night'
color: $highlight-foreground, color: $highlight-foreground,
bg-color: darken($highlight-background, 2) bg-color: darken($highlight-background, 2)
} }
$highlight-scrollbar = darken($highlight-background, 6) $highlight-scrollbar = lighten($highlight-background, 8)
if $highlighEnable if $highlighEnable
$highlight-comment = #676E95 $highlight-comment = #676E95
@@ -63,7 +63,7 @@ if $highlight_theme == 'ocean'
color: $highlight-foreground, color: $highlight-foreground,
bg-color: darken($highlight-background, 2) bg-color: darken($highlight-background, 2)
} }
$highlight-scrollbar = darken($highlight-background, 5) $highlight-scrollbar = lighten($highlight-background, 8)
if $highlighEnable if $highlighEnable
$highlight-comment = rgba(101, 115, 126, .8) $highlight-comment = rgba(101, 115, 126, .8)

View File

@@ -9,7 +9,7 @@
// index // index
&.full_page &.full_page
min-height: $index_top_img_height height: $index_top_img_height
background-attachment: fixed background-attachment: fixed
#site-info #site-info
@@ -70,7 +70,7 @@
// page // page
&.not-home-page &.not-home-page
min-height: 20rem height: 20rem
+maxWidth768() +maxWidth768()
height: 14rem height: 14rem
@@ -86,7 +86,7 @@
// post // post
&.post-bg &.post-bg
min-height: 20rem height: 20rem
+maxWidth768() +maxWidth768()
height: 18rem height: 18rem
@@ -118,7 +118,7 @@
&.not-top-img &.not-top-img
margin-bottom: .5rem margin-bottom: .5rem
min-height: 60px height: 60px
background: 0 background: 0
#nav #nav

View File

@@ -1,7 +1,7 @@
#body-wrap #body-wrap
display: flex display: flex
flex-direction: column flex-direction: column
height: 100vh min-height: 100vh
.layout .layout
display: flex display: flex

View File

@@ -33,7 +33,7 @@ $font-color = #1F2D3D
$rem = 20px $rem = 20px
$text-line-height = 2 $text-line-height = 2
$web-bg = hexo-config('background') && unquote(hexo-config('background')) $web-bg = hexo-config('background') && unquote(hexo-config('background'))
$index_top_img_height = hexo-config('index_top_img_height') ? convert(hexo-config('index_top_img_height')) : 100% $index_top_img_height = hexo-config('index_top_img_height') ? convert(hexo-config('index_top_img_height')) : 100vh
$index_site_info_top = hexo-config('index_site_info_top') ? convert(hexo-config('index_site_info_top')) : 43% $index_site_info_top = hexo-config('index_site_info_top') ? convert(hexo-config('index_site_info_top')) : 43%
// Global color & SVG // Global color & SVG
$light-blue = $theme-color $light-blue = $theme-color

View File

@@ -225,10 +225,11 @@ document.addEventListener('DOMContentLoaded', function () {
function addPhotoFigcaption () { function addPhotoFigcaption () {
document.querySelectorAll('#article-container img').forEach(function (item) { document.querySelectorAll('#article-container img').forEach(function (item) {
const parentEle = item.parentNode 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') const ele = document.createElement('div')
ele.className = 'img-alt is-center' ele.className = 'img-alt is-center'
ele.textContent = item.getAttribute('alt') ele.textContent = altValue
parentEle.insertBefore(ele, item.nextSibling) parentEle.insertBefore(ele, item.nextSibling)
} }
}) })

View File

@@ -47,9 +47,10 @@ window.addEventListener('load', () => {
.then(str => new window.DOMParser().parseFromString(str, 'text/xml')) .then(str => new window.DOMParser().parseFromString(str, 'text/xml'))
.then(data => { .then(data => {
const datas = [...data.querySelectorAll('entry')].map(function (item) { const datas = [...data.querySelectorAll('entry')].map(function (item) {
const content = item.querySelector('content')
return { return {
title: item.querySelector('title').textContent, title: item.querySelector('title').textContent,
content: item.querySelector('content').textContent, content: content ? content.textContent : '',
url: item.querySelector('url').textContent url: item.querySelector('url').textContent
} }
}) })