标签外挂是Hexo独有的功能,并不是标准的Markdown格式。
以下的写法,只适用于Butterfly主题,用在其它主题上不会有效果,甚至可能会报错。使用前请留意
标签外挂虽然能为主题带来一些额外的功能和UI方面的强化,但是,标签外挂也有明显的限制,使用时请留意。
Note (Bootstrap Callout) 移植于next主题,并进行修改。
修改 主题配置文件
1 2 3 4 5 6 7 8 9 10 11 12 note: style: simple icons: false border_radius: 3 light_bg_offset: 0
icons和light_bg_offset只对方法一生效
Note 标签外挂有两种用法
1 2 3 {% note [class] [no-icon] [style] %} Any content (support inline tags too.io). {% endnote %}
名称
用法
class
【可选】标识,不同的标识有不同的配色 ( default / primary / success / info / warning / danger )
no-icon
【可选】不显示 icon
style
【可选】可以覆盖配置中的 style (simple/modern/flat/disabled)
simple
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 {% note simple %} 默认 提示块标签 {% endnote %} {% note default simple %} default 提示块标签 {% endnote %} {% note primary simple %} primary 提示块标签 {% endnote %} {% note success simple %} success 提示块标签 {% endnote %} {% note info simple %} info 提示块标签 {% endnote %} {% note warning simple %} warning 提示块标签 {% endnote %} {% note danger simple %} danger 提示块标签 {% endnote %}
modern
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 {% note modern %} 默认 提示块标签 {% endnote %} {% note default modern %} default 提示块标签 {% endnote %} {% note primary modern %} primary 提示块标签 {% endnote %} {% note success modern %} success 提示块标签 {% endnote %} {% note info modern %} info 提示块标签 {% endnote %} {% note warning modern %} warning 提示块标签 {% endnote %} {% note danger modern %} danger 提示块标签 {% endnote %}
flat
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 {% note flat %} 默认 提示块标签 {% endnote %} {% note default flat %} default 提示块标签 {% endnote %} {% note primary flat %} primary 提示块标签 {% endnote %} {% note success flat %} success 提示块标签 {% endnote %} {% note info flat %} info 提示块标签 {% endnote %} {% note warning flat %} warning 提示块标签 {% endnote %} {% note danger flat %} danger 提示块标签 {% endnote %}
disabled
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 {% note disabled %} 默认 提示块标签 {% endnote %} {% note default disabled %} default 提示块标签 {% endnote %} {% note primary disabled %} primary 提示块标签 {% endnote %} {% note success disabled %} success 提示块标签 {% endnote %} {% note info disabled %} info 提示块标签 {% endnote %} {% note warning disabled %} warning 提示块标签 {% endnote %} {% note danger disabled %} danger 提示块标签 {% endnote %}
no-icon
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 {% note no-icon %} 默认 提示块标签 {% endnote %} {% note default no-icon %} default 提示块标签 {% endnote %} {% note primary no-icon %} primary 提示块标签 {% endnote %} {% note success no-icon %} success 提示块标签 {% endnote %} {% note info no-icon %} info 提示块标签 {% endnote %} {% note warning no-icon %} warning 提示块标签 {% endnote %} {% note danger no-icon %} danger 提示块标签 {% endnote %}
3.2.0 以上版本支持
1 2 3 {% note [color] [icon] [style] %} Any content (support inline tags too.io). {% endnote %}
名称
用法
color
【可选】顔色 (default / blue / pink / red / purple / orange / green)
icon
【可选】可配置自定义 icon (只支持 fontawesome 图标, 也可以配置 no-icon )
style
【可选】可以覆盖配置中的 style (simple/modern/flat/disabled)
simple
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 {% note 'fab fa-cc-visa' simple %} 你是刷 Visa 还是 UnionPay {% endnote %} {% note blue 'fas fa-bullhorn' simple %} 2021年快到了.... {% endnote %} {% note pink 'fas fa-car-crash' simple %} 小心开车 安全至上 {% endnote %} {% note red 'fas fa-fan' simple%} 这是三片呢?还是四片? {% endnote %} {% note orange 'fas fa-battery-half' simple %} 你是刷 Visa 还是 UnionPay {% endnote %} {% note purple 'far fa-hand-scissors' simple %} 剪刀石头布 {% endnote %} {% note green 'fab fa-internet-explorer' simple %} 前端最讨厌的浏览器 {% endnote %}
modern
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 {% note 'fab fa-cc-visa' modern %} 你是刷 Visa 还是 UnionPay {% endnote %} {% note blue 'fas fa-bullhorn' modern %} 2021年快到了.... {% endnote %} {% note pink 'fas fa-car-crash' modern %} 小心开车 安全至上 {% endnote %} {% note red 'fas fa-fan' modern%} 这是三片呢?还是四片? {% endnote %} {% note orange 'fas fa-battery-half' modern %} 你是刷 Visa 还是 UnionPay {% endnote %} {% note purple 'far fa-hand-scissors' modern %} 剪刀石头布 {% endnote %} {% note green 'fab fa-internet-explorer' modern %} 前端最讨厌的浏览器 {% endnote %}
flat
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 {% note 'fab fa-cc-visa' flat %} 你是刷 Visa 还是 UnionPay {% endnote %} {% note blue 'fas fa-bullhorn' flat %} 2021年快到了.... {% endnote %} {% note pink 'fas fa-car-crash' flat %} 小心开车 安全至上 {% endnote %} {% note red 'fas fa-fan' flat%} 这是三片呢?还是四片? {% endnote %} {% note orange 'fas fa-battery-half' flat %} 你是刷 Visa 还是 UnionPay {% endnote %} {% note purple 'far fa-hand-scissors' flat %} 剪刀石头布 {% endnote %} {% note green 'fab fa-internet-explorer' flat %} 前端最讨厌的浏览器 {% endnote %}
disabled
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 {% note 'fab fa-cc-visa' disabled %} 你是刷 Visa 还是 UnionPay {% endnote %} {% note blue 'fas fa-bullhorn' disabled %} 2021年快到了.... {% endnote %} {% note pink 'fas fa-car-crash' disabled %} 小心开车 安全至上 {% endnote %} {% note red 'fas fa-fan' disabled %} 这是三片呢?还是四片? {% endnote %} {% note orange 'fas fa-battery-half' disabled %} 你是刷 Visa 还是 UnionPay {% endnote %} {% note purple 'far fa-hand-scissors' disabled %} 剪刀石头布 {% endnote %} {% note green 'fab fa-internet-explorer' disabled %} 前端最讨厌的浏览器 {% endnote %}
no-icon
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 {% note no-icon %} 你是刷 Visa 还是 UnionPay {% endnote %} {% note blue no-icon %} 2021年快到了.... {% endnote %} {% note pink no-icon %} 小心开车 安全至上 {% endnote %} {% note red no-icon %} 这是三片呢?还是四片? {% endnote %} {% note orange no-icon %} 你是刷 Visa 还是 UnionPay {% endnote %} {% note purple no-icon %} 剪刀石头布 {% endnote %} {% note green no-icon %} 前端最讨厌的浏览器 {% endnote %}
Gallery相册图库
2.2.0以上提供
一个图库集合的写法。
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 4 5 <div class="gallery-group-main"> {% galleryGroup '壁纸' '收藏的一些壁纸' '/Gallery/wallpaper' https://i.loli.net/2019/11/10/T7Mu8Aod3egmC4Q.png %} {% galleryGroup '漫威' '关于漫威的图片' '/Gallery/marvel' https://i.loli.net/2019/12/25/8t97aVlp4hgyBGu.jpg %} {% galleryGroup 'OH MY GIRL' '关于OH MY GIRL的图片' '/Gallery/ohmygirl' https://i.loli.net/2019/12/25/hOqbQ3BIwa6KWpo.jpg %} </div>
壁纸
收藏的一些壁纸
漫威
关于漫威的图片
OH MY GIRL
关于OH MY GIRL的图片
Gallery相册
2.0.0 以上提供
区别于旧版的Gallery相册,新的 Gallery 相册会自动根据图片长度进行排版,书写也更加方便,与 markdown 格式一样。可根据需要插入到相应的 md。
写法:
1 2 3 {% gallery [lazyload],[rowHeight],[limit] %} markdown 图片格式 {% endgallery %}
参数
解释
lazyload
【可选】点击按钮加载更多图片,填写 true/false。默认为 false。
rowHeight
【可选】图片显示的高度,如果需要一行显示更多的图片,可设置更小的数字。默认为 220。
limit
【可选】每次加载多少张照片。默认为 10。
Demo
1 2 3 4 5 6 7 8 9 10 11 {% gallery %} markdown 图片格式 {% endgallery %} {% gallery true,220,10 %} markdown 图片格式 {% endgallery %} {% gallery true,,10 %} markdown 图片格式 {% endgallery %}
例如
1 2 3 4 5 6 7 8 9 10 {% gallery %}         {% endgallery %}
[{"url":"https://i.loli.net/2019/12/25/Fze9jchtnyJXMHN.jpg","alt":""},{"url":"https://i.loli.net/2019/12/25/ryLVePaqkYm4TEK.jpg","alt":""},{"url":"https://i.loli.net/2019/12/25/gEy5Zc1Ai6VuO4N.jpg","alt":""},{"url":"https://i.loli.net/2019/12/25/d6QHbytlSYO4FBG.jpg","alt":""},{"url":"https://i.loli.net/2019/12/25/6nepIJ1xTgufatZ.jpg","alt":""},{"url":"https://i.loli.net/2019/12/25/E7Jvr4eIPwUNmzq.jpg","alt":""},{"url":"https://i.loli.net/2019/12/25/mh19anwBSWIkGlH.jpg","alt":""},{"url":"https://i.loli.net/2019/12/25/2tu9JC8ewpBFagv.jpg","alt":""}]
写法:
1 2 {% gallery url,[link],[lazyload],[rowHeight],[limit] %} {% endgallery %}
参数
解释
url
【必须】 识别词
link
【必须】远程的 json 链接
lazyload
【可选】点击按钮加载更多图片,填写 true/false。默认为 false。
rowHeight
【可选】图片显示的高度,如果需要一行显示更多的图片,可设置更小的数字。默认为 220。
limit
【可选】每次加载多少张照片。默认为10。
远程链接 Json 的例子
有三个参数,url是必须存在的,alt 和 title 可有,也可没有。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 [ { "url" : "https://cdn.jsdelivr.net/gh/jerryc127/CDN/img/IMG_0556.jpg" , "alt" : "IMG_0556.jpg" , "title" : "这是title" } , { "url" : "https://cdn.jsdelivr.net/gh/jerryc127/CDN/img/IMG_0472.jpg" , "alt" : "IMG_0472.jpg" } , { "url" : "https://cdn.jsdelivr.net/gh/jerryc127/CDN/img/IMG_0453.jpg" , "alt" : "" } , { "url" : "https://cdn.jsdelivr.net/gh/jerryc127/CDN/img/IMG_0931.jpg" , "alt" : "" } ]
Demo
1 2 3 4 5 6 7 8 {% gallery url,https://xxxx.com/sss.json %} {% endgallery %} {% gallery url,https://xxxx.com/sss.json,true,220,10 %} {% endgallery %} {% gallery url,https://xxxx.com/sss.json,true,,10 %} {% endgallery %}