mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2025-09-15 12:58:48 +08:00
18 lines
377 B
JavaScript
18 lines
377 B
JavaScript
/**
|
|
* inlineImg 圖片
|
|
* {% inlineImg src height %}
|
|
*/
|
|
|
|
'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}/>`
|
|
}
|
|
|
|
hexo.extend.tag.register('inlineImg', inlineImg, { ends: false })
|