安装方式
- 安装插件,在博客根目录[Blogroot]下打开终端,运行以下指令:
1
| npm install hexo-butterfly-tag-plugins-plus --save
|
考虑到hexo自带的markdown渲染插件hexo-renderer-marked与外挂标签语法的兼容性较差,建议您将其替换成hexo-renderer-kramed
1 2
| npm uninstall hexo-renderer-marked --save npm install hexo-renderer-kramed --save
|
- 添加配置信息,以下为写法示例
在站点配置文件_config.yml或者主题配置文件_config.butterfly.yml中添加
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
tag_plugins: enable: true priority: 5 issues: false link: placeholder: /img/link.png CDN: anima: https://npm.elemecdn.com/hexo-butterfly-tag-plugins-plus@latest/lib/assets/font-awesome-animation.min.css jquery: https://npm.elemecdn.com/jquery@latest/dist/jquery.min.js issues: https://npm.elemecdn.com/hexo-butterfly-tag-plugins-plus@latest/lib/assets/issues.js iconfont: //at.alicdn.com/t/font_2032782_8d5kxvn09md.js carousel: https://npm.elemecdn.com/hexo-butterfly-tag-plugins-plus@latest/lib/assets/carousel-touch.js tag_plugins_css: https://npm.elemecdn.com/hexo-butterfly-tag-plugins-plus@latest/lib/tag_plugins.css
|
- 参数释义
| 参数 |
备选值/类型 |
释义 |
| enable |
true/false |
【必选】控制开关 |
| priority |
number |
【可选】过滤器优先级,数值越小,执行越早,默认为10,选填 |
| issues |
true/false |
【可选】issues标签控制开关,默认为false |
| link.placeholder |
【必选】link卡片外挂标签的默认图标 |
|
| CDN.anima URL |
URL |
【可选】issues标签依赖 |
| CDN.iconfont URL |
URL |
【可选】iconfont标签symbol样式引入,如果不想引入,则设为false |
| CDN.carousel |
URL |
【可选】carousel旋转相册标签鼠标拖动依赖,如果不想引入则设为false |
| CDN.tag_plugins_css |
URL |
【可选】外挂标签样式的CSS依赖,为避免CDN缓存延迟,建议将@latest改为具体版本号 |
使用方式
分栏tab
1 2 3 4 5
| {% tabs Unique name, [index] %} <!-- tab [Tab caption] [@icon] --> Any content (support inline tags too). <!-- endtab --> {% endtabs %}
|
- Unique name :
- 选项卡块标签的唯一名称,不带逗号。
- 将在#id中用作每个标签及其索引号的前缀。
- 如果名称中包含空格,则对于生成#id,所有空格将由破折号代替。
- 仅当前帖子/页面的URL必须是唯一的!
- [index]:
- 活动选项卡的索引号。
- 如果未指定,将选择第一个标签(1)。
- 如果index为-1,则不会选择任何选项卡。
- 可选参数。
- [Tab caption]:
- 当前选项卡的标题。
- 如果未指定标题,则带有制表符索引后缀的唯一名称将用作制表符的标题。
- 如果未指定标题,但指定了图标,则标题将为空。
- 可选参数。
- [@icon]:
- FontAwesome图标名称(全名,看起来像“ fas fa-font”)
- 可以指定带空格或不带空格;
- 例如’Tab caption @icon’ 和 ‘Tab caption@icon’.
- 可选参数。
Demo 1 - 预设选择第一个【默认】
Demo 2 - 预设选择tabs
Demo 3 - 没有预设值
Demo 4 - 自定义Tab名 + 只有icon + icon和Tab名
1 2 3 4 5 6 7 8 9 10 11 12 13
| {% tabs test1 %} <!-- tab --> **This is Tab 1.** <!-- endtab -->
<!-- tab --> **This is Tab 2.** <!-- endtab -->
<!-- tab --> **This is Tab 3.** <!-- endtab --> {% endtabs %}
|
1 2 3 4 5 6 7 8 9 10 11 12 13
| {% tabs test2, 3 %} <!-- tab --> **This is Tab 1.** <!-- endtab -->
<!-- tab --> **This is Tab 2.** <!-- endtab -->
<!-- tab --> **This is Tab 3.** <!-- endtab --> {% endtabs %}
|
1 2 3 4 5 6 7 8 9 10 11 12 13
| {% tabs test3, -1 %} <!-- tab --> **This is Tab 1.** <!-- endtab -->
<!-- tab --> **This is Tab 2.** <!-- endtab -->
<!-- tab --> **This is Tab 3.** <!-- endtab --> {% endtabs %}
|
1 2 3 4 5 6 7 8 9 10 11 12 13
| {% tabs test4 %} <!-- tab 第一个Tab --> **tab名字为第一个Tab** <!-- endtab -->
<!-- tab @fab fa-apple-pay --> **只有图标 没有Tab名字** <!-- endtab -->
<!-- tab 炸弹@fas fa-bomb --> **名字+icon** <!-- endtab --> {% endtabs %}
|
1
| {% link 标题, 链接, 图片链接(可选) %}
|
1 2
| {% referto [id] , [literature] %} {% referfrom [id] , [literature] , [url] %}
|
referto 引用上标
id: 上标序号内容,需与referfrom标签的id对应才能实现跳转
literature: 引用的参考文献名称
referfrom 引用出处
id: 序号内容,需与referto标签的id对应才能实现跳转
literature: 引用的参考文献名称
url: 引用的参考文献链接,可省略
Akilarの糖果屋(akilar.top)是一个私人性质的博客</span>[1]Akilarの糖果屋群聊简介参考资料</span></span>,从各类教程至生活点滴,无话不谈。建群的目的是提供一个闲聊的场所。博客采用Hexo框架</span>[2]Hexo中文文档参考资料</span></span>,Butterfly主题</span>[3]Butterfly 安装文档(一) 快速开始参考资料</span></span>
本项目参考了Volantis</span>[4]hexo-theme-volantis 标签插件参考资料</span></span>的标签样式。引入[tag].js,并针对butterfly主题修改了相应的[tag].styl。在此鸣谢Volantis主题众开发者。
主要参考内容包括各个volantis的内置标签插件文档</span>[5]Volantis文档:内置标签插件参考资料</span></span>
Butterfly主题的各个衍生魔改</span>[6]Butterfly 安装文档:标签外挂(Tag Plugins参考资料</span></span></span>[7]小弋の生活馆全样式预览参考资料</span></span></span>[8]l-lin-font-awesome-animation参考资料</span></span></span>[9]小康的butterfly主题使用文档参考资料</span></span>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| Akilarの糖果屋(akilar.top)是一个私人性质的博客{% referto '[1]','Akilarの糖果屋群聊简介' %},从各类教程至生活点滴,无话不谈。建群的目的是提供一个闲聊的场所。博客采用Hexo框架{% referto '[2]','Hexo中文文档' %},Butterfly主题{% referto '[3]','Butterfly 安装文档(一) 快速开始' %}
本项目参考了Volantis{% referto '[4]','hexo-theme-volantis 标签插件' %}的标签样式。引入`[tag].js`,并针对`butterfly`主题修改了相应的`[tag].styl`。在此鸣谢`Volantis`主题众开发者。 主要参考内容包括各个volantis的内置标签插件文档{% referto '[5]','Volantis文档:内置标签插件' %} Butterfly主题的各个衍生魔改{% referto '[6]','Butterfly 安装文档:标签外挂(Tag Plugins' %}{% referto '[7]','小弋の生活馆全样式预览' %}{% referto '[8]','l-lin-font-awesome-animation' %}{% referto '[9]','小康的butterfly主题使用文档' %}
{% referfrom '[1]','Akilarの糖果屋群聊简介','https://jq.qq.com/?_wv=1027&k=pGLB2C0N' %} {% referfrom '[2]','Hexo中文文档','https://hexo.io/zh-cn/docs/' %} {% referfrom '[3]','Butterfly 安装文档(一) 快速开始','https://butterfly.js.org/posts/21cfbf15/' %} {% referfrom '[4]','hexo-theme-volantis 标签插件','https://volantis.js.org/v5/tag-plugins/' %} {% referfrom '[5]','Volantis文档:内置标签插件','https://volantis.js.org/tag-plugins/' %} {% referfrom '[6]','Butterfly 安装文档:标签外挂(Tag Plugins','https://butterfly.js.org/posts/4aa8abbe/#%E6%A8%99%E7%B1%A4%E5%A4%96%E6%8E%9B%EF%BC%88Tag-Plugins%EF%BC%89' %} {% referfrom '[7]','小弋の生活馆全样式预览','https://lovelijunyi.gitee.io/posts/c898.html' %} {% referfrom '[8]','l-lin-font-awesome-animation','https://github.com/l-lin/font-awesome-animation' %} {% referfrom '[9]','小康的butterfly主题使用文档','https://www.antmoe.com/posts/3b43914f/' %}
|