label: 3.5.0

pull/465/head
Jerry 4 years ago
parent 80c03b15b1
commit 3b72c87996

@ -1,9 +1,9 @@
# hexo-theme-butterfly
![version](https://img.shields.io/github/package-json/v/jerryc127/hexo-theme-butterfly)
![master version](https://img.shields.io/github/package-json/v/jerryc127/hexo-theme-butterfly/master?color=%231ab1ad&label=master)
![master version](https://img.shields.io/github/package-json/v/jerryc127/hexo-theme-butterfly/dev?label=dev)
![https://img.shields.io/npm/v/hexo-theme-butterfly?color=%09%23bf00ff](https://img.shields.io/npm/v/hexo-theme-butterfly?color=%09%23bf00ff)
![hexo version](https://img.shields.io/badge/hexo-4.2+-0e83c)
![npm download](https://img.shields.io/npm/dw/hexo-theme-butterfly?color=green)
![license](https://img.shields.io/github/license/jerryc127/hexo-theme-butterfly?color=FF5531)
Demo: 👍 [Butterfly](https://butterfly.js.org/) || 🤞 [JerryC](https://jerryc.me/)

@ -1,12 +1,11 @@
# hexo-theme-butterfly
![version](https://img.shields.io/github/package-json/v/jerryc127/hexo-theme-butterfly)
![master version](https://img.shields.io/github/package-json/v/jerryc127/hexo-theme-butterfly/master?color=%231ab1ad&label=master)
![master version](https://img.shields.io/github/package-json/v/jerryc127/hexo-theme-butterfly/dev?label=dev)
![https://img.shields.io/npm/v/hexo-theme-butterfly?color=%09%23bf00ff](https://img.shields.io/npm/v/hexo-theme-butterfly?color=%09%23bf00ff)
![hexo version](https://img.shields.io/badge/hexo-4.2+-0e83c)
![npm download](https://img.shields.io/npm/dw/hexo-theme-butterfly?color=green)
![license](https://img.shields.io/github/license/jerryc127/hexo-theme-butterfly?color=FF5531)
預覽: 👍 [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')

Loading…
Cancel
Save