label: 3.5.0

This commit is contained in:
Jerry
2020-12-30 23:26:54 +08:00
parent 80c03b15b1
commit 3b72c87996
9 changed files with 37 additions and 34 deletions

View File

@@ -1,9 +1,9 @@
# hexo-theme-butterfly # 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) ![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) ![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) ![license](https://img.shields.io/github/license/jerryc127/hexo-theme-butterfly?color=FF5531)
Demo: 👍 [Butterfly](https://butterfly.js.org/) || 🤞 [JerryC](https://jerryc.me/) Demo: 👍 [Butterfly](https://butterfly.js.org/) || 🤞 [JerryC](https://jerryc.me/)

View File

@@ -1,12 +1,11 @@
# hexo-theme-butterfly # 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) ![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) ![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) ![license](https://img.shields.io/github/license/jerryc127/hexo-theme-butterfly?color=FF5531)
預覽: 👍 [Butterfly](https://butterfly.js.org/) || 🤞 [JerryC](https://jerryc.me/) 預覽: 👍 [Butterfly](https://butterfly.js.org/) || 🤞 [JerryC](https://jerryc.me/)
文檔: 📖 [Butterfly Docs](https://butterfly.js.org/posts/21cfbf15/) 文檔: 📖 [Butterfly Docs](https://butterfly.js.org/posts/21cfbf15/)

View File

@@ -309,6 +309,7 @@ valine:
waline: waline:
serverURL: # Waline server address url serverURL: # Waline server address url
avatar: monsterid # gravatar style https://zh-tw.gravatar.com/site/implement/images/#default-image avatar: monsterid # gravatar style https://zh-tw.gravatar.com/site/implement/images/#default-image
emojiCDN: # emoji CDN
bg: /image/comment_bg.png # waline background bg: /image/comment_bg.png # waline background
option: option:

View File

@@ -83,7 +83,7 @@
when 'Gitalk' when 'Gitalk'
+countBlock +countBlock
a(href=url_for(page.path) + '#post-comment') a(href=url_for(page.path) + '#post-comment')
span.gitalk-#card-toc span.gitalk-comment-count
when 'Twikoo' when 'Twikoo'
+countBlock +countBlock
a(href=url_for(page.path) + '#post-comment') a(href=url_for(page.path) + '#post-comment')

View File

@@ -1,4 +1,7 @@
- let option = theme.waline.option ? JSON.stringify(theme.waline.option) : false - let option = theme.waline.option ? JSON.stringify(theme.waline.option) : false
- let emojiMaps = '""'
if site.data.waline
- emojiMaps = JSON.stringify(site.data.waline)
script. script.
function loadWaline () { function loadWaline () {
@@ -8,6 +11,8 @@ script.
serverURL: '!{theme.waline.serverURL}', serverURL: '!{theme.waline.serverURL}',
avatar: '#{theme.waline.avatar}', avatar: '#{theme.waline.avatar}',
path: location.pathname, path: location.pathname,
emojiCDN: '#{theme.waline.emojiCDN}',
emojiMaps: !{emojiMaps},
} }
if (!{Boolean(option)}) { if (!{Boolean(option)}) {

View File

@@ -80,7 +80,7 @@ script.
'content': changeContent(e.comment), 'content': changeContent(e.comment),
'mail': e.mail, 'mail': e.mail,
'nick': e.nick, 'nick': e.nick,
'url': e.url, 'url': e.url + '#' + e.objectId,
'date': e.createdAt, 'date': e.createdAt,
} }
}) })

View File

@@ -63,7 +63,7 @@ script.
'content': changeContent(e.comment), 'content': changeContent(e.comment),
'mail': e.mail, 'mail': e.mail,
'nick': e.nick, 'nick': e.nick,
'url': e.url, 'url': e.url + '#' + e.objectId,
'date': e.createdAt, 'date': e.createdAt,
} }
}) })

View File

@@ -1,6 +1,6 @@
{ {
"name": "hexo-theme-butterfly", "name": "hexo-theme-butterfly",
"version": "3.5.0-b3", "version": "3.5.0",
"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": {

View File

@@ -247,33 +247,31 @@ document.addEventListener('DOMContentLoaded', function () {
* fancybox和 mediumZoom * fancybox和 mediumZoom
*/ */
const addFancybox = function (ele) { const addFancybox = function (ele) {
if (ele.length) { const runFancybox = (ele) => {
const runFancybox = (ele) => { ele.each(function (i, o) {
ele.each(function (i, o) { const $this = $(o)
const $this = $(o) const lazyloadSrc = $this.attr('data-lazy-src') || $this.attr('src')
const lazyloadSrc = $this.attr('data-lazy-src') || $this.attr('src') const dataCaption = $this.attr('alt') || ''
const dataCaption = $this.attr('alt') || '' $this.wrap(`<a href="${lazyloadSrc}" data-fancybox="group" data-caption="${dataCaption}" class="fancybox"></a>`)
$this.wrap(`<a href="${lazyloadSrc}" data-fancybox="group" data-caption="${dataCaption}" class="fancybox"></a>`) })
})
$().fancybox({ $().fancybox({
selector: '[data-fancybox]', selector: '[data-fancybox]',
loop: true, loop: true,
transitionEffect: 'slide', transitionEffect: 'slide',
protect: true, protect: true,
buttons: ['slideShow', 'fullScreen', 'thumbs', 'close'], buttons: ['slideShow', 'fullScreen', 'thumbs', 'close'],
hash: false hash: false
}) })
} }
if (typeof $.fancybox === 'undefined') { if (typeof $.fancybox === 'undefined') {
$('head').append(`<link rel="stylesheet" type="text/css" href="${GLOBAL_CONFIG.source.fancybox.css}">`) $('head').append(`<link rel="stylesheet" type="text/css" href="${GLOBAL_CONFIG.source.fancybox.css}">`)
$.getScript(`${GLOBAL_CONFIG.source.fancybox.js}`, function () { $.getScript(`${GLOBAL_CONFIG.source.fancybox.js}`, function () {
runFancybox($(ele))
})
} else {
runFancybox($(ele)) runFancybox($(ele))
} })
} else {
runFancybox($(ele))
} }
} }