mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-10 21:17:07 +08:00
Compare commits
58 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de8e35d0d0 | ||
|
|
101cb45b90 | ||
|
|
641fb56b22 | ||
|
|
7c859ef66d | ||
|
|
42bc175718 | ||
|
|
bbb9beb8f9 | ||
|
|
eca1487a5e | ||
|
|
3f796adc88 | ||
|
|
32b83a0d81 | ||
|
|
ad87304302 | ||
|
|
7b520c62f6 | ||
|
|
54c6a509c7 | ||
|
|
f0eaf2d8b0 | ||
|
|
c439930786 | ||
|
|
f4e5cef399 | ||
|
|
637da0702b | ||
|
|
6904850044 | ||
|
|
4c5abe0cc5 | ||
|
|
e8cfc6e083 | ||
|
|
823dc03090 | ||
|
|
24cf0a11e6 | ||
|
|
a7e512d764 | ||
|
|
4a69c623fc | ||
|
|
eb823b0a2d | ||
|
|
8f412c90da | ||
|
|
6a1330de84 | ||
|
|
eb5a356a4e | ||
|
|
f4b07340f7 | ||
|
|
17d8062968 | ||
|
|
d4b69051aa | ||
|
|
59f6ce63e3 | ||
|
|
cd78f639dd | ||
|
|
8e4c20f6d4 | ||
|
|
e984efa35c | ||
|
|
863cf1e780 | ||
|
|
85b8a83371 | ||
|
|
d73960f2a2 | ||
|
|
fcd430902d | ||
|
|
ee45f6517f | ||
|
|
67201ac58d | ||
|
|
315d3b50df | ||
|
|
727a2d97d9 | ||
|
|
54b67987c1 | ||
|
|
26df41c772 | ||
|
|
4e7051ad77 | ||
|
|
955b4bae6a | ||
|
|
95ddf28f3b | ||
|
|
e901f9ad35 | ||
|
|
462422e279 | ||
|
|
bad24849bd | ||
|
|
eb242f0809 | ||
|
|
b1795e3def | ||
|
|
54b212ead3 | ||
|
|
4bbc035f54 | ||
|
|
40ba3bb92f | ||
|
|
e2cb0242bb | ||
|
|
559afab632 | ||
|
|
c134d4fc86 |
@@ -461,9 +461,9 @@ google_adsense:
|
||||
# --------------------------------------
|
||||
|
||||
site_verification:
|
||||
# - name: google_site_verification
|
||||
# - name: google-site-verification
|
||||
# content: xxxxxx
|
||||
# - name: baidu_site_verification
|
||||
# - name: baidu-site-verification
|
||||
# content: xxxxxxx
|
||||
|
||||
# Beautify/Effect (美化/效果)
|
||||
|
||||
11
layout/includes/third-party/comments/waline.pug
vendored
11
layout/includes/third-party/comments/waline.pug
vendored
@@ -1,14 +1,17 @@
|
||||
- const { serverURL, avatar, avatarCDN, visitor, option } = theme.waline
|
||||
|
||||
script.
|
||||
function loadWaline () {
|
||||
function initWaline () {
|
||||
const waline = new Waline(Object.assign({
|
||||
el: '#waline-wrap',
|
||||
serverURL: '!{theme.waline.serverURL}',
|
||||
avatar: '#{theme.waline.avatar}',
|
||||
serverURL: '!{serverURL}',
|
||||
avatar: '#{avatar}',
|
||||
avatarCDN: '!{avatarCDN || "https://sdn.geekzu.org/avatar/"}',
|
||||
path: location.pathname,
|
||||
visitor: #{theme.waline.visitor},
|
||||
visitor: !{visitor},
|
||||
dark: 'html[data-theme="dark"]'
|
||||
}, !{JSON.stringify(theme.waline.option)}))
|
||||
}, !{JSON.stringify(option)}))
|
||||
}
|
||||
|
||||
if (typeof Waline === 'function') initWaline()
|
||||
|
||||
12
layout/includes/third-party/math/mathjax.pug
vendored
12
layout/includes/third-party/math/mathjax.pug
vendored
@@ -21,7 +21,17 @@ script.
|
||||
math.end = {node: text, delim: '', n: 0}
|
||||
doc.math.push(math)
|
||||
}
|
||||
}, '']
|
||||
}, ''],
|
||||
insertScript: [200, () => {
|
||||
document.querySelectorAll('mjx-container:not\([display]\)').forEach(node => {
|
||||
const target = node.parentNode
|
||||
if (target.nodeName.toLowerCase() === 'li') {
|
||||
target.parentNode.classList.add('has-jax')
|
||||
} else {
|
||||
target.classList.add('has-jax')
|
||||
}
|
||||
});
|
||||
}, '', false]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hexo-theme-butterfly",
|
||||
"version": "3.8.0",
|
||||
"version": "3.8.4",
|
||||
"description": "A Simple and Card UI Design theme for Hexo",
|
||||
"main": "package.json",
|
||||
"scripts": {
|
||||
@@ -20,11 +20,11 @@
|
||||
},
|
||||
"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",
|
||||
"hexo-renderer-pug": "^1.0.0"
|
||||
"hexo-renderer-pug": "^2.0.0"
|
||||
},
|
||||
"homepage": "https://butterfly.js.org/",
|
||||
"author": "Jerry <i@immyw.com>",
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
// index
|
||||
&.full_page
|
||||
min-height: $index_top_img_height
|
||||
height: $index_top_img_height
|
||||
background-attachment: fixed
|
||||
|
||||
#site-info
|
||||
@@ -70,7 +70,7 @@
|
||||
|
||||
// page
|
||||
&.not-home-page
|
||||
min-height: 20rem
|
||||
height: 20rem
|
||||
|
||||
+maxWidth768()
|
||||
height: 14rem
|
||||
@@ -86,7 +86,7 @@
|
||||
|
||||
// post
|
||||
&.post-bg
|
||||
min-height: 20rem
|
||||
height: 20rem
|
||||
|
||||
+maxWidth768()
|
||||
height: 18rem
|
||||
@@ -118,7 +118,7 @@
|
||||
|
||||
&.not-top-img
|
||||
margin-bottom: .5rem
|
||||
min-height: 60px
|
||||
height: 60px
|
||||
background: 0
|
||||
|
||||
#nav
|
||||
|
||||
@@ -90,14 +90,11 @@ if hexo-config('waline.bg')
|
||||
display: none
|
||||
|
||||
// mathjax
|
||||
mjx-container
|
||||
mjx-container[display],
|
||||
.has-jax
|
||||
overflow-x: auto
|
||||
overflow-y: hidden
|
||||
|
||||
&:not([display])
|
||||
display: inline-grid
|
||||
max-width: 100%
|
||||
|
||||
.aplayer
|
||||
color: $font-black
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#body-wrap
|
||||
display: flex
|
||||
flex-direction: column
|
||||
height: 100vh
|
||||
min-height: 100vh
|
||||
|
||||
.layout
|
||||
display: flex
|
||||
|
||||
@@ -33,7 +33,7 @@ $font-color = #1F2D3D
|
||||
$rem = 20px
|
||||
$text-line-height = 2
|
||||
$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%
|
||||
// Global color & SVG
|
||||
$light-blue = $theme-color
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
})
|
||||
@@ -294,7 +295,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
}
|
||||
|
||||
const addMediumZoom = () => {
|
||||
const zoom = mediumZoom(document.querySelectorAll('#article-container :not(a)>img'))
|
||||
const zoom = mediumZoom(document.querySelectorAll('#article-container :not(a):not(.flink-item-icon) > img'))
|
||||
zoom.on('open', e => {
|
||||
const photoBg = document.documentElement.getAttribute('data-theme') === 'dark' ? '#121212' : '#fff'
|
||||
zoom.update({
|
||||
@@ -305,7 +306,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
const jqLoadAndRun = () => {
|
||||
const $fancyboxEle = GLOBAL_CONFIG.lightbox === 'fancybox'
|
||||
? document.querySelectorAll('#article-container :not(a):not(.gallery-group) > img, #article-container > img')
|
||||
? document.querySelectorAll('#article-container :not(a):not(.gallery-group):not(.flink-item-icon) > img, #article-container > img')
|
||||
: []
|
||||
const fbLengthNoZero = $fancyboxEle.length > 0
|
||||
const $jgEle = document.querySelectorAll('#article-container .justified-gallery')
|
||||
|
||||
@@ -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