最新内容请查看 Butterfly 文档(二) 主题页面 与 Butterfly 文档(四) 标签外挂
Front-matter Front-matter 是档案最上方以 --- 分隔的区域,用于指定个別档案的变数。
如果标注可选的参數,可根据自己需要添加,不用全部都写在 markdown 里
Page Front-matter 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 --- title: date: updated: type: comments: description: keywords: top_img: mathjax: katex: aside: aplayer: highlight_ shrink:random: limit: type: value: ---
寫法
类型
解釋
title
String
【必需】页面标题
date
Date
【必需】页面创建日期
type
String
【必需】标签、分类和友情链接三个页面需要配置
updated
Date
【可选】页面更新日期
description
String
【可选】页面描述
keywords
String
【可选】页面关键字
comments
Boolean
【可选】显示页面评论模块(默认 true)
top_img
Boolean
【可选】页面顶部图片
mathjax
Boolean
【可选】显示 mathjax(当设置 mathjax 的 per_page: false 时,才需要配置,默认 false)
katex
Boolean
【可选】显示 katex(当设置 katex 的 per_page: false 时,才需要配置,默认 false)
aside
Boolean
【可选】显示侧边栏 (默认 true)
aplayer
Boolean
【可选】在需要的页面加载 aplayer 的 js 和 css,请参考文章下面的 音樂 配置
highlight_shrink
Boolean
【可选】配置代码框是否展开(true/false)(默认为设置中 highlight_shrink 的配置)
random
Boolean
【可选】配置友情链接是否随机排序(默认为 false)
limit
Number
【可选】配置説説显示数量
limit.type
String
【可选】配置説説显示数量的类型 (date 或者 num)
limit.value
Number
【可选】配置説説显示数量的值
Post Front-matter 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 --- title: date: updated: tags: categories: keywords: description: top_img: comments: cover: toc: toc_ number:toc_style_ simple: copyright: copyright_author: copyright_ author_href: copyright_ url:copyright_info: mathjax: katex: aplayer: highlight_ shrink:aside: abcjs: noticeOutdate: ---
寫法
解釋
title
【必需】文章标题
date
【必需】文章创建日期
updated
【可选】文章更新日期
tags
【可选】文章标签
categories
【可选】文章分类
keywords
【可选】文章关键字
description
【可选】文章描述
top_img
【可选】文章頂部图片
cover
【可选】文章缩略图(如果没有设置 top_img,文章页顶部将显示缩略图,可设为 false/图片地址/留空)
comments
【可选】显示文章评论模块(默认 true)
toc
【可选】显示文章 TOC(默认为设置中 toc 的 enable 配置)
toc_number
【可选】显示 toc_number(默认为设置中 toc 的 number 配置)
toc_style_simple
【可选】显示 toc 简洁模式
copyright
【可选】显示文章版权模块(默认为设置中 post_copyright 的 enable 配置)
copyright_author
【可选】文章版权模块的文章作者
copyright_author_href
【可选】文章版权模块的文章作者链接
copyright_url
【可选】文章版权模块的文章链接链接
copyright_info
【可选】文章版权模块的版权声明文字
mathjax
【可选】显示 mathjax(当设置 mathjax 的 per_page: false 时,才需要配置,默认 false)
katex
【可选】显示 katex(当设置 katex 的 per_page: false 时,才需要配置,默认 false)
aplayer
【可选】在需要的页面加载 aplayer 的 js 和 css,请参考文章下面的音乐 配置
highlight_shrink
【可选】配置代码框是否展开(true/false)(默认为设置中 highlight_shrink 的配置)
aside
【可选】显示侧边栏 (默认 true)
abcjs
【可选】加载 abcjs (当设置 abcjs 的 per_page: false 时,才需要配置,默认 false )
noticeOutdate
【可选】文章过期提醒 (默认为设置中 noticeOutdate 的 enable 配置)
标签外挂(Tag Plugins) 標籤外掛是Hexo獨有的功能,並不是標準的Markdown格式。
以下的寫法,只適用於Butterfly主題,用在其它主題上不會有效果,甚至可能會報錯。使用前請留意
標籤外掛雖然能為主題帶來一些額外的功能和UI方面的強化,但是,標籤外掛也有明顯的限制,使用時請留意。
Note (Bootstrap Callout) 通用設置 用法 1 用法 2(自定義 icon)
移植於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 %}