mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-17 04:40:53 +08:00
breaking changes: CDN 配置了 version 為 true, 本地鏈接也會加上版本號 closed #1218
breaking changes: CDN option 部分參數名字修改 feat: 升級 fancybox 到 v5 feat: 更新 facebook js 版本 feat: 移除 gitter 聊天插件 closed #1212 improvement: 社交圖標 hover 旋轉180度 closed #1195 improvement: 代碼優化 fix: 開啟 archor 後, pace.js 會隨着 archor 添加而觸發的問題 fix: 修復設置圖片時,圖片後綴大寫而導致識別錯誤的 bug closed #1205
This commit is contained in:
@@ -15,18 +15,10 @@ function gallery (args, content) {
|
||||
args = args.join(' ').split(',')
|
||||
let rowHeight, limit, lazyload, type, dataStr
|
||||
|
||||
// url,[link],[lazyload],[rowHeight],[limit]
|
||||
if (args[0] === 'url') {
|
||||
dataStr = args[1]
|
||||
lazyload = args[2] === 'true'
|
||||
rowHeight = args[3] || 220
|
||||
limit = args[4] || 10
|
||||
type = ' url'
|
||||
[type, dataStr, lazyload, rowHeight = 220, limit = 10] = args // url,[link],[lazyload],[rowHeight],[limit]
|
||||
} else {
|
||||
rowHeight = args[1] || 220
|
||||
limit = args[2] || 10
|
||||
lazyload = args[0] === 'true'
|
||||
type = ' data'
|
||||
[lazyload, rowHeight = 220, limit = 10] = args // [lazyload],[rowHeight],[limit]
|
||||
const regex = /!\[(.*?)\]\(([^\s]*)\s*(?:["'](.*?)["']?)?\s*\)/g
|
||||
let m
|
||||
const arr = []
|
||||
@@ -44,7 +36,8 @@ function gallery (args, content) {
|
||||
dataStr = JSON.stringify(arr)
|
||||
}
|
||||
|
||||
const lazyloadClass = lazyload ? 'lazyload' : ''
|
||||
type = type ? ' url' : ' data'
|
||||
const lazyloadClass = lazyload === 'true' ? 'lazyload' : ''
|
||||
|
||||
return `<div class="gallery">
|
||||
<div class="fj-gallery ${lazyloadClass + type}" data-rowHeight="${rowHeight}" data-limit="${limit}">
|
||||
|
||||
Reference in New Issue
Block a user