From ae09fb89b50a3b56ad37742a91a3d60f21d35706 Mon Sep 17 00:00:00 2001 From: Jerry Date: Mon, 15 Mar 2021 20:44:35 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20=E5=A2=9E=E5=8A=A0=20tags=20?= =?UTF-8?q?=E6=A8=99=E7=B0=BD=E5=A4=96=E6=8C=82=20inlineImg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- scripts/tag/inlineImg.js | 17 +++++++++++++++++ source/css/_tags/inlineImg.styl | 6 ++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 scripts/tag/inlineImg.js create mode 100644 source/css/_tags/inlineImg.styl diff --git a/package.json b/package.json index 2ec0ed4..0dc250b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-theme-butterfly", - "version": "3.7.0-b7", + "version": "3.7.0-b8", "description": "A Simple and Card UI Design theme for Hexo", "main": "package.json", "scripts": { diff --git a/scripts/tag/inlineImg.js b/scripts/tag/inlineImg.js new file mode 100644 index 0000000..9bcbfdb --- /dev/null +++ b/scripts/tag/inlineImg.js @@ -0,0 +1,17 @@ +/** + * 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 `` +} + +hexo.extend.tag.register('inlineImg', inlineImg, { ends: false }) diff --git a/source/css/_tags/inlineImg.styl b/source/css/_tags/inlineImg.styl new file mode 100644 index 0000000..c8bb0c1 --- /dev/null +++ b/source/css/_tags/inlineImg.styl @@ -0,0 +1,6 @@ +#article-container + .inline-img + display: inline + margin: 0 3px + height: 1.1em + vertical-align: text-bottom \ No newline at end of file