Hexo Next tag插件

Hexo Next tag插件

Tag Plugin 是一种使 Hexo 支持特殊样式内容的方法。例如,我们无法在标准 Markdown 中显示具有自定义尺寸的图像。然后我们可以使用标签插件来解决它。 Hexo 有很多可以帮助用户的标签。 Hexo 还具有主题接口,使主题能够创建自己的标签。

文本居中引用

1
{% cq %}世间所有的相遇,都是久别重逢{% endcq %}

显示效果:

世间所有的相遇,都是久别重逢

提示块

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
26
27
28
{% note default %}
default 提示块标签
{% endnote %}

{% note primary %}
primary 提示块标签
{% endnote %}

{% note success %}
success 提示块标签
{% endnote %}

{% note info %}
info 提示块标签
{% endnote %}

{% note warning %}
warning 提示块标签
{% endnote %}

{% note danger %}
danger 提示块标签
{% endnote %}

{% note info no-icon This is a summary %}
#### Details and summary (No icon)
Note with summary: `note info no-icon This is a summary`
{% endnote %}

显示效果:

default 提示块标签

primary 提示块标签

success 提示块标签

info 提示块标签

warning 提示块标签

danger 提示块标签

This is a summary

Details and summary (No icon)

Note with summary: note info no-icon This is a summary

修改配置文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Note tag (bs-callout).
note:
# Note tag style values:
# - simple bs-callout old alert style. Default.
# - modern bs-callout new (v2-v3) alert style.
# - flat flat callout style with background, like on Mozilla or StackOverflow.
# - disabled disable all CSS styles import of note tag.
# 风格
style: flat
# 要不要图标
icons: true
# 圆角矩形
border_radius: 3
# Offset lighter of background in % for modern and flat styles (modern: -12 | 12; flat: -18 | 6).
# Offset also applied to label tag variables. This option can work with disabled note tag.
light_bg_offset: 0

标签

1
2
{% label default@默认 %} {% label primary@主要 %} {% label success@成功 %} {% label info@信息 %} {% label warning@警告 %} {% label danger@危险 %} 
{% label success@这是成功的信息%}

显示效果:

默认 主要 成功 信息 警告 危险 这是成功的信息

选项卡

1
2
3
4
5
6
7
8
9
10
11
{% tabs tab,1 %} 名字为tab,默认在第1个选项卡,如果是-1则隐藏
<!-- tab -->
**选项卡 1**
<!-- endtab -->
<!-- tab -->
**选项卡 2**
<!-- endtab -->
<!-- tab A -->
**选项卡 3** 名字为A
<!-- endtab -->
{% endtabs %}

修改配置文件

1
2
3
4
5
6
7
# Tabs tag
tabs:
enable: true
transition:
tabs: true
labels: true
border_radius: 0

选项卡 1

选项卡 2

选项卡 3 名字为A

按钮

1
{% button url, text, icon [class], [title] %}
  • url : 绝对或相对 URL
  • text : 按钮文字,如果未指定图标则为必须
  • icon : FontAwesome 图标名称(开头没有’fa-‘)。如果未指定文本,则为必需
  • [class] : FontAwesome 类:fa-fw | fa-lg | fa-2x | fa-3x | fa-4x | fa-5X ,可选参数。
  • [title] : 鼠标悬停时的工具提示,可选参数。

显示效果:

go baidu