标签外挂是 Hexo 独有的功能,并不是标准的 Markdown 格式,以下的写法,只适用于 Butterfly 主题。

Note (Bootstrap Callout)

1
2
3
{% note [class] [[no-icon]/[icon]] [style] %}
Any content (support inline tags too.io).
{% endnote %}
属性 用法 参数
class 【可选】标识,不同的标识有不同的配色 default / primary / success / info / warning / danger
no-icon / icon 【可选】不显示 icon 可配置自定义 icon ,支持 fontawesome 图标
style 【可选】可以覆盖配置中的 style simple/modern/flat/disabled

内置 icon

默认 提示块标籤

默认 提示块标籤

primary 提示块标籤

warning 提示块标籤

danger 提示块标籤

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{% note simple %}
默认 提示块标籤
{% endnote %}

{% note primary no-icon %}
默认 提示块标籤
{% endnote %}

{% note primary modern %}
primary 提示块标籤
{% endnote %}

{% note warning flat %}
warning 提示块标籤
{% endnote %}

{% note danger disabled %}
danger 提示块标籤
{% endnote %}

自定义 icon

你是刷 Visa 还是 UnionPay

2021年快到了….

1
2
3
4
5
6
{% note 'fab fa-cc-visa' simple %}
你是刷 Visa 还是 UnionPay
{% endnote %}
{% note blue 'fas fa-bullhorn' simple %}
2021年快到了....
{% endnote %}

Gallery

Gallery相册图库

1
2
3
4
5
<div class="gallery-group-main">
{% galleryGroup name description link img-url %}
{% galleryGroup name description link img-url %}
{% galleryGroup name description link img-url %}
</div>
属性 用法
name 图库名字
description 图库描述
link 连接到对应相册的地址
img-url 图库封面的地址
1
2
3
<div class="gallery-group-main">
{% galleryGroup '壁纸' '收藏的一些壁纸' '/Gallery/wallpaper' https://i.loli.net/2019/11/10/T7Mu8Aod3egmC4Q.png %}
{% galleryGroup 'OH MY GIRL' '关于OH MY GIRL的图片' '/Gallery/ohmygirl' https://i.loli.net/2019/12/25/hOqbQ3BIwa6KWpo.jpg %}
## Gallery相册 > Gallery相册会自动根据图片长度(大小)进行排版,与markdown格式一样,可根据需要插入到相应的md。
1
2
3
{% gallery %}
markdown 图片格式
{% endgallery %}
1
2
3
4
5
6
7
{% gallery %}
![](https://i.loli.net/2019/12/25/Fze9jchtnyJXMHN.jpg)
![](https://i.loli.net/2019/12/25/ryLVePaqkYm4TEK.jpg)
![](https://i.loli.net/2019/12/25/gEy5Zc1Ai6VuO4N.jpg)
![](https://i.loli.net/2019/12/25/d6QHbytlSYO4FBG.jpg)
![](https://i.loli.net/2019/12/25/6nepIJ1xTgufatZ.jpg)
{% endgallery %}
# tag-hide 内容隐藏 > tag-hide内的标签外挂content内都不建议有h1 - h6 等标题,可能会导致Toc的滚动出现异常。 ## inline > inline 在文本里面添加按钮隐藏内容,只限文字
1
{% hideInline content,display,bg,color %}
| 属性 | 参数 | | ------- | ----------------------- | | content | 文本内容 | | display | 【可选】按钮显示的文字 | | bg | 【可选】 按钮的背景颜色 | | color | 【可选】 按钮文字的颜色 | 哪个英文字母最酷? 因为西装裤(C装酷)
1
哪个英文字母最酷? {% hideInline 因为西装裤(C装酷),查看答案,#00c4b6,#fff %}
## block > block独立的block隐藏内容,可以隐藏很多内容,包括图片,代码块等等
1
2
3
{% hideBlock 按钮文字 %}
文本,图片,代码块等
{% endhideBlock %}
| 属性 | 参数 | | ------- | ----------------------- | | content | 文本内容 | | display | 【可选】按钮显示的文字 | | bg | 【可选】 按钮的背景颜色 | | color | 【可选】 按钮文字的颜色 |

PigPigPig…

1
console.log('PigPigPig...')

## Toggle > 如果你需要展示的内容太多,可以把它隐藏在收缩框里,需要时再把它展开。(display 不能包含英文逗号,可用‚)
1
2
3
{% hideToggle display,bg,color %}
content
{% endhideToggle %}
Butterfly安装方法

在你的博客根目录里

git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly

如果想要安装比较新的dev分支,可以

git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/Butterfly

# mermaid 图表 > mermaid文档: https://mermaid-js.github.io/mermaid/#/ > 使用mermaid标籤可以绘製Flowchart(流程图)、Sequence diagram(时序图)、Class Diagram(类别图)、State Diagram(状态图)、Gantt(甘特图)和Pie Chart(圆形图)
1
2
3
{% mermaid %}
内容
{% endmermaid %}
## Flowchart(流程图)
1
2
3
4
5
6
7
8
9
10
11
12
{% mermaid %}
flowchart TD
Start --> Stop
{% endmermaid %}

{% mermaid %}
flowchart LR
A[Hard edge] -->|Link text| B(Round edge)
B --> C{Decision}
C -->|One| D[Result one]
C -->|Two| E[Result two]
{% endmermaid %}
## Sequence diagram(时序图)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{% mermaid %}
sequenceDiagram
Alice->>John: Hello John, how are you?
John-->>Alice: Great!
Alice-)John: See you later!
{% endmermaid %}

{% mermaid %}
sequenceDiagram
actor Alice
actor Bob
Alice->>Bob: Hi Bob
Bob->>Alice: Hi Alice
{% endmermaid %}
## Class Diagram(类别图)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{% mermaid %}
classDiagram
Animal <|-- Duck
Animal <|-- Fish
Animal <|-- Zebra
Animal : +int age
Animal : +String gender
Animal: +isMammal()
Animal: +mate()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}
{% endmermaid %}
## State Diagram(状态图)
1
2
3
4
5
6
7
8
9
{% mermaid %}
stateDiagram-v2
[*] --> Still
Still --> [*]
Still --> Moving
Moving --> Still
Moving --> Crash
Crash --> [*]
{% endmermaid %}
## Gantt(甘特图)
1
2
3
4
5
6
7
8
9
10
11
{% mermaid %}
gantt
title A Gantt Diagram
dateFormat YYYY-MM-DD
section Section
Task in one :a1, 2014-01-01, 30d
Another task :after a1 , 20d
section Another
Task in sec :2014-01-12 , 12d
Another task : 24d
{% endmermaid %}
## Pie Chart(圆形图)
1
2
3
4
5
6
7
8
{% mermaid %}
pie
title Key elements in Product X
"Calcium" : 42.96
"Potassium" : 50.05
"Magnesium" : 10.01
"Iron" : 5
{% endmermaid %}
# Tabs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{% tabs Unique name, [index] %}
<!-- tab [Tab caption] [@icon] -->
Any content (support inline tags too).
<!-- endtab -->
{% endtabs %}





Unique name : Unique name of tabs block tag without comma.
Will be used in #id's as prefix for each tab with their index numbers.
If there are whitespaces in name, for generate #id all whitespaces will replaced by dashes.
Only for current url of post/page must be unique!
[index] : Index number of active tab.
If not specified, first tab (1) will be selected.
If index is -1, no tab will be selected. It's will be something like spoiler.
Optional parameter.
[Tab caption] : Caption of current tab.
If not caption specified, unique name with tab index suffix will be used as caption of tab.
If not caption specified, but specified icon, caption will empty.
Optional parameter.
[@icon] : FontAwesome icon name (full-name, look like 'fas fa-font')
Can be specified with or without space; e.g. 'Tab caption @icon' similar to 'Tab caption@icon'.
Optional parameter.

This is Tab 1.

This is Tab 2.

This is Tab 3.

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 %}
# Button
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{% btn [url],[text],[icon],[color] [style] [layout] [position] [size] %}

[url] : 链接
[text] : 按钮文字
[icon] : [可选] 图标
[color] : [可选] 按钮背景顔色(默认style时)
按钮字体和边框顔色(outline时)
default/blue/pink/red/purple/orange/green
[style] : [可选] 按钮样式 默认实心
outline/留空
[layout] : [可选] 按钮佈局 默认为line
block/留空
[position] : [可选] 按钮位置 前提是设置了layout为block 默认为左边
center/right/留空
[size] : [可选] 按钮大小
larger/留空
## 行内 # #
1
2
{% btn '#',# %}
{% btn '#',#,,outline%}
## 固定 # # #
1
2
3
{% btn '#',#,far fa-hand-point-right,block larger %}
{% btn '#',#,far fa-hand-point-right,block center larger %}
{% btn '#',#,far fa-hand-point-right,block right blue larger %}
## 居中多个
# # # # # #
1
2
3
4
5
6
7
8
<div class="btn-center">
{% btn '#',#,far fa-hand-point-right,larger %}
{% btn '#',#,far fa-hand-point-right,blue larger %}
{% btn '#',#,far fa-hand-point-right,pink larger %}
{% btn '#',#,far fa-hand-point-right,outline purple larger %}
{% btn '#',#,far fa-hand-point-right,outline orange larger %}
{% btn '#',#,far fa-hand-point-right,outline green larger %}
</div>

inlineImg 内联图片

主题中的图片都是默认以块级元素显示,如果想以内联元素显示,可以使用这个标签外挂。

1
2
3
4
{% inlineImg [src] [height] %}

[src] : 图片链接
[height] : 【可选】图片高度单位:px

我后面是一张行内图片:

1
我后面是一张行内图片:{% inlineImg https://i.loli.net/2021/03/19/5M4jUB3ynq7ePgw.png 150px %}

label 高亮文字

1
{% label text color %}
参数 用法
text 高亮文字
color 【可选】背景颜色,默认为 default
default/blue/pink/red/purple/orange/green

臣亮言:先帝 创业未半,而中道崩殂 。今天下三分,益州疲敝 ,此诚危急存亡之秋 也!然侍衞之臣,不懈于内;忠志之士 ,忘身于外者,盖追先帝之殊遇,欲报之于陛下也。诚宜开张圣听,以光先帝遗德,恢弘志士之气;不宜妄自菲薄,引喻失义,以塞忠谏之路也。
宫中、府中,俱为一体;陟罚臧否,不宜异同。若有作奸犯科 ,及为忠善者,宜付有司,论其刑赏,以昭陛下平明之治;不宜偏私,使内外异法也。

1
2
臣亮言:{% label 先帝 %}创业未半,而{% label 中道崩殂 blue %}。今天下三分,{% label 益州疲敝 pink %},此诚{% label 危急存亡之秋 red %}也!然侍衞之臣,不懈于内;{% label 忠志之士 purple %},忘身于外者,盖追先帝之殊遇,欲报之于陛下也。诚宜开张圣听,以光先帝遗德,恢弘志士之气;不宜妄自菲薄,引喻失义,以塞忠谏之路也。
宫中、府中,俱为一体;陟罚臧否,不宜异同。若有{% label 作奸 orange %}、{% label 犯科 green %},及为忠善者,宜付有司,论其刑赏,以昭陛下平明之治;不宜偏私,使内外异法也。

timeline 时间线

1
2
3
4
5
6
7
8
{% timeline title,color %}
<!-- timeline title -->
xxxxx
<!-- endtimeline -->
<!-- timeline title -->
xxxxx
<!-- endtimeline -->
{% endtimeline %}
参数 用法
title 标题/时间线
color timeline 颜色
default(留空) / blue / pink / red / purple / orange / green

2022

01-02

这是测试页面

01-30

这是测试页面

1
2
3
4
5
6
7
8
{% timeline 2022,pink%}
<!-- timeline 01-02 -->
这是测试页面
<!-- endtimeline -->
<!-- timeline 01-30 -->
这是测试页面
<!-- endtimeline -->
{% endtimeline %}

flink 链接列表

支持 yml 格式

1
2
3
{% flink %}
xxxxxx
{% endflink %}
1
2
3
4
5
6
7
8
9
10
11
12
13
{% flink %}
- class_name: 网站
class_desc: 值得推荐的网站
link_list:
- name: Youtube
link: https://www.youtube.com/
avatar: https://i.loli.net/2020/05/14/9ZkGg8v3azHJfM1.png
descr: 视频网站
- name: Twitter
link: https://twitter.com/
avatar: https://i.loli.net/2020/05/14/5VyHPQqR6LWF39a.png
descr: 社交分享
{% endflink %}