-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #166 from valor-x/dev
v1.5.5
- Loading branch information
Showing
49 changed files
with
684 additions
and
753 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
'use strict' | ||
|
||
function bilibili(args) { | ||
return `<iframe class="bvideo" src="${args}"></iframe>` | ||
return `<iframe class="bvideo" width="100%" height="600" src="//player.bilibili.com/player.html?aid=1351697032&bvid=${args}&p=1" border="0" frameBorder="no" framespacing="0" allowFullScreen="true"></iframe>` | ||
} | ||
|
||
hexo.extend.tag.register('bilibili', bilibili, { ends: false }) | ||
hexo.extend.tag.register('bvideo', bilibili, {ends: false}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
'use strict'; | ||
|
||
function galleryGroup(args, content) { | ||
const title = args[0]; | ||
const description = args[1]; | ||
const link = args[2]; | ||
const image = args[3]; | ||
|
||
return `<div class="gallery-item" onclick="pjax.loadUrl('/${link}/')"> | ||
<img class="cover" src="${image}" /> | ||
<span class="title">${title}</span> | ||
<span class="desc">${description}</span> | ||
</div>`; | ||
} | ||
|
||
const urlFor = require('hexo-util').url_for.bind(hexo) | ||
|
||
const gallery = (args, content) => { | ||
args = args.join(' ').split(',') | ||
let button = false | ||
let type = 'data' | ||
let dataStr = '' | ||
|
||
if (args[0] === 'url') { | ||
[type, dataStr, button] = args // url,[link],[lazyload] | ||
} else { | ||
[button] = args // [lazyload] | ||
const regex = /!\[(.*?)\]\(([^\s]*)\s*(?:["'](.*?)["']?)?\s*\)/g | ||
let m | ||
const arr = [] | ||
while ((m = regex.exec(content)) !== null) { | ||
if (m.index === regex.lastIndex) { | ||
regex.lastIndex++ | ||
} | ||
arr.push({ | ||
url: m[2], | ||
alt: m[1], | ||
title: m[3] | ||
}) | ||
} | ||
|
||
dataStr = JSON.stringify(arr) | ||
} | ||
|
||
return `<div class="gallery-container" data-type="${type}" data-button="${button}"> | ||
<div class="gallery-data">${dataStr}</div> | ||
<div class="gallery-items"> | ||
</div> | ||
</div>` | ||
} | ||
|
||
hexo.extend.tag.register('gallery', gallery, {ends: true}); | ||
|
||
hexo.extend.tag.register('galleryGroup',galleryGroup, {ends: false}); |
Oops, something went wrong.