开心数据

人生天地间,忽如远行客。

0%

hexo next主题的note标签

背景

昨天将blog由wordpress切换为hexo之后,选择了next主题。
在一项一项查看测试next主题的配置项时,计划测试测试note标签的展示效果,于是有了此文。

配置

配置路径: themes/next/_config.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 补充了中文注释
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: modern
# 是否在 Note 标签中显示图标
icons: false
# 调整 modern 和 flat 样式的背景亮度偏移百分比
# 正值使背景更亮,负值使背景更暗
# 此选项也会应用到 label 标签变量,即使禁用 Note 标签也可以使用此选项
# 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
3
{% note [class] [no-icon] [style] %}
内容文本
{% endnote %}

代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{% note default %}
默认提示框
{% endnote %}

{% note primary %}
主要信息提示框
{% endnote %}

{% note success %}
成功提示框
{% endnote %}

{% note info %}
信息提示框
{% endnote %}

{% note warning %}
警告提示框
{% endnote %}

{% note danger %}
危险提示框
{% endnote %}

效果

simple modern flat
simple 样式 modern 样式 flat 样式

icons:true 效果

modern flat
modern-icon 样式 flat-icon 样式