mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-08 12:07:06 +08:00
label: 3.5.0
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
# hexo-theme-butterfly
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
Demo: 👍 [Butterfly](https://butterfly.js.org/) || 🤞 [JerryC](https://jerryc.me/)
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
# hexo-theme-butterfly
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
|
||||
預覽: 👍 [Butterfly](https://butterfly.js.org/) || 🤞 [JerryC](https://jerryc.me/)
|
||||
|
||||
文檔: 📖 [Butterfly Docs](https://butterfly.js.org/posts/21cfbf15/)
|
||||
|
||||
@@ -309,6 +309,7 @@ valine:
|
||||
waline:
|
||||
serverURL: # Waline server address url
|
||||
avatar: monsterid # gravatar style https://zh-tw.gravatar.com/site/implement/images/#default-image
|
||||
emojiCDN: # emoji CDN
|
||||
bg: /image/comment_bg.png # waline background
|
||||
option:
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
when 'Gitalk'
|
||||
+countBlock
|
||||
a(href=url_for(page.path) + '#post-comment')
|
||||
span.gitalk-#card-toc
|
||||
span.gitalk-comment-count
|
||||
when 'Twikoo'
|
||||
+countBlock
|
||||
a(href=url_for(page.path) + '#post-comment')
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
- let option = theme.waline.option ? JSON.stringify(theme.waline.option) : false
|
||||
- let emojiMaps = '""'
|
||||
if site.data.waline
|
||||
- emojiMaps = JSON.stringify(site.data.waline)
|
||||
|
||||
script.
|
||||
function loadWaline () {
|
||||
@@ -8,6 +11,8 @@ script.
|
||||
serverURL: '!{theme.waline.serverURL}',
|
||||
avatar: '#{theme.waline.avatar}',
|
||||
path: location.pathname,
|
||||
emojiCDN: '#{theme.waline.emojiCDN}',
|
||||
emojiMaps: !{emojiMaps},
|
||||
}
|
||||
|
||||
if (!{Boolean(option)}) {
|
||||
|
||||
@@ -80,7 +80,7 @@ script.
|
||||
'content': changeContent(e.comment),
|
||||
'mail': e.mail,
|
||||
'nick': e.nick,
|
||||
'url': e.url,
|
||||
'url': e.url + '#' + e.objectId,
|
||||
'date': e.createdAt,
|
||||
}
|
||||
})
|
||||
|
||||
@@ -63,7 +63,7 @@ script.
|
||||
'content': changeContent(e.comment),
|
||||
'mail': e.mail,
|
||||
'nick': e.nick,
|
||||
'url': e.url,
|
||||
'url': e.url + '#' + e.objectId,
|
||||
'date': e.createdAt,
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hexo-theme-butterfly",
|
||||
"version": "3.5.0-b3",
|
||||
"version": "3.5.0",
|
||||
"description": "A Simple and Card UI Design theme for Hexo",
|
||||
"main": "package.json",
|
||||
"scripts": {
|
||||
|
||||
@@ -247,33 +247,31 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
* fancybox和 mediumZoom
|
||||
*/
|
||||
const addFancybox = function (ele) {
|
||||
if (ele.length) {
|
||||
const runFancybox = (ele) => {
|
||||
ele.each(function (i, o) {
|
||||
const $this = $(o)
|
||||
const lazyloadSrc = $this.attr('data-lazy-src') || $this.attr('src')
|
||||
const dataCaption = $this.attr('alt') || ''
|
||||
$this.wrap(`<a href="${lazyloadSrc}" data-fancybox="group" data-caption="${dataCaption}" class="fancybox"></a>`)
|
||||
})
|
||||
const runFancybox = (ele) => {
|
||||
ele.each(function (i, o) {
|
||||
const $this = $(o)
|
||||
const lazyloadSrc = $this.attr('data-lazy-src') || $this.attr('src')
|
||||
const dataCaption = $this.attr('alt') || ''
|
||||
$this.wrap(`<a href="${lazyloadSrc}" data-fancybox="group" data-caption="${dataCaption}" class="fancybox"></a>`)
|
||||
})
|
||||
|
||||
$().fancybox({
|
||||
selector: '[data-fancybox]',
|
||||
loop: true,
|
||||
transitionEffect: 'slide',
|
||||
protect: true,
|
||||
buttons: ['slideShow', 'fullScreen', 'thumbs', 'close'],
|
||||
hash: false
|
||||
})
|
||||
}
|
||||
$().fancybox({
|
||||
selector: '[data-fancybox]',
|
||||
loop: true,
|
||||
transitionEffect: 'slide',
|
||||
protect: true,
|
||||
buttons: ['slideShow', 'fullScreen', 'thumbs', 'close'],
|
||||
hash: false
|
||||
})
|
||||
}
|
||||
|
||||
if (typeof $.fancybox === 'undefined') {
|
||||
$('head').append(`<link rel="stylesheet" type="text/css" href="${GLOBAL_CONFIG.source.fancybox.css}">`)
|
||||
$.getScript(`${GLOBAL_CONFIG.source.fancybox.js}`, function () {
|
||||
runFancybox($(ele))
|
||||
})
|
||||
} else {
|
||||
if (typeof $.fancybox === 'undefined') {
|
||||
$('head').append(`<link rel="stylesheet" type="text/css" href="${GLOBAL_CONFIG.source.fancybox.css}">`)
|
||||
$.getScript(`${GLOBAL_CONFIG.source.fancybox.js}`, function () {
|
||||
runFancybox($(ele))
|
||||
}
|
||||
})
|
||||
} else {
|
||||
runFancybox($(ele))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -289,7 +287,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) > img, #article-container > img')
|
||||
: []
|
||||
const fbLengthNoZero = $fancyboxEle.length > 0
|
||||
const $jgEle = document.querySelectorAll('#article-container .justified-gallery')
|
||||
|
||||
Reference in New Issue
Block a user