mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-12 22:17:06 +08:00
breaking changes: 更改 rightside-bottom 為 rightside_bottom
feat: 置頂圖標改為在標題左側 feat: 可配置打賞按鈕的文字 feat: 側邊欄增加 系列文章顯示 feat: 增加 series 系列文章 標籤外掛 feat: 移除 addthis 分享 improvement: 代碼優化 improvement: tabs 標籤外掛的回到頂部箭頭位置調整 improvement: 更新 plugin.yml
This commit is contained in:
@@ -1,17 +1,19 @@
|
||||
/**
|
||||
* inlineImg 圖片
|
||||
* {% inlineImg src height %}
|
||||
* @param {Array} args 圖片名稱和高度
|
||||
* @param {string} args[0] 圖片名稱
|
||||
* @param {number} args[1] 圖片高度
|
||||
* @returns {string} 圖片標籤
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
const urlFor = require('hexo-util').url_for.bind(hexo)
|
||||
|
||||
function inlineImg (args) {
|
||||
const img = args[0]
|
||||
const height = args[1] ? `style="height:${args[1]}"` : ''
|
||||
|
||||
return `<img class="inline-img" src="${urlFor(img)}" ${height}/>`
|
||||
const inlineImg = ([img, height = '']) => {
|
||||
const heightStyle = height ? `style="height:${height}"` : ''
|
||||
const src = urlFor(img)
|
||||
return `<img class="inline-img" src="${src}" ${heightStyle} />`
|
||||
}
|
||||
|
||||
hexo.extend.tag.register('inlineImg', inlineImg, { ends: false })
|
||||
|
||||
Reference in New Issue
Block a user