🖼 所有搭建博客的汇总在这里:Blog全程搭建,示例🚀test.ruiqingyan.com

🌺 之后所有的操作都在Webstrom进行,需要的可以点进去看看

🌻 参考 Jerry’s Blog,用更多相关问题请去他的博客看

1、语言

修改站点配置文件 _config.yml,默认是en,支持下面三种语言

  • default(en)
  • zh-CN(简体中文)
  • zh-TW(繁体中文)
2408.1.配置项目语言

2、网站资料

修改网站各种资料,例如标题、副标题、URL等个人资料,请修改博客根目录的_config.yml

2408.2.配置网站资料

下面是一个对应_config.yml的中文释义

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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/

# 0、部署本地的端口号,默认4000,如果多个的话要避开重复的端口
# 访问端口,默认localhost:4000,设置后访问端口localhost:4001
server:
port: 4001

# 1、Site 核心内容
title: 花夕 & Blog #网站标题
subtitle: '远赴人间惊鸿宴,一睹人间盛世颜' #网站的副标题
description: '远赴人间惊鸿宴,一睹人间盛世颜' #简介或者格言
keywords: #关键词
author: 花夕 #作者
language: zh-CN #主题语言
timezone: 'Asia/Shanghai' #中国的时区

# 2、网址URL(推荐改url,不推荐改permalink)
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
url: https://ruiqingyan.com # 页面底部分享的url(就是做好博客之后每页都有分享页面)
permalink: :year/:month/:day/:title/ # 文章的永久链接格式
permalink_defaults: # 永久链接中每个段的默认值
pretty_urls:
trailing_index: true # 尾随index.html,设置为false以删除它 true
trailing_html: true # 跟踪.html,设置为false以删除它(不适用于跟踪index.html) true

# 3、文档管理,一般不动
source_dir: source # 源文件夹。您的内容存储在哪里 source
public_dir: public # 公共文件夹。在哪里生成静态站点 public
tag_dir: tags # 标签目录 tags
archive_dir: archives # 存档目录 archives
category_dir: categories # 类别目录 categories
code_dir: downloads/code # 包括代码目录(source_dir的子目录)
i18n_dir: :lang # i18n目录 :lang
skip_render: # 将复制到public原始的路径,而不被渲染。您可以使用glob表达式进行路径匹配。
#skip_render:“我的页面/**/*” 将在不更改的情况下输出`source/mypage/index.html`和`source/mypage/code.js`。
## skip_render:“_posts/test-post.md” 这也可以用来排除帖子,#将忽略`source/_posts/test-post.md`。

# 4、写作,一般不动
new_post_name: :title.md #新帖子的文件名格式
default_layout: post #默认布局
titlecase: false #将标题转换为标题案例
external_link:
enable: true #在新选项卡中打开外部链接
field: site #仅适用于整个site或post
exclude: '' #排除主机名。在适用时指定子域,包括www
filename_case: 0 #将文件名转换为1小写;2大写
render_drafts: false #显示草稿
post_asset_folder: false #资产文件夹
relative_link: false #制作相对于根文件夹的链接
future: true
syntax_highlighter: highlight.js
highlight: #代码块语法高亮显示设置
line_number: true
auto_detect: false
tab_replace: ''
wrap: true
hljs: false
prismjs: #代码块语法高亮显示设置
enable: false
preprocess: true
line_number: true
tab_replace: ''

# 5、主页设置
# 一般不动
index_generator: #生成帖子存档
path: ''
per_page: 10 #每页显示的帖子
order_by: -date #帖子订单。默认情况下,按降序日期(从新到旧)排序
# pagination_dir: 'page' #显示在page下的页面数量(新版删了)

# 7、分页
# 一般不动
per_page: 10 #每页显示贴子数目
pagination_dir: page #格式url

# 8、主题
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: butterfly

# 9、推送仓库,Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
type: git
repository: https://github.com/ruiqingyan1/ruiqingyan1.github.io.git #你的仓库地址
branch: master

### 10、一些其他
# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# Metadata elements
## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
meta_generator: true

# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss
## updated_option supports 'mtime', 'date', 'empty'
updated_option: 'mtime'

# Include / Exclude file(s)
## include:/exclude: options only apply to the 'source/' folder
include:
exclude:
ignore:

3、导航栏设置(Navigation bar settings)

这里开始配置都在_config.butterfly.yml文件内配置,也叫主题配置文件

3.1 网站

首先是页面顶端的图标(图片一般是放在主目录的/source/img/下,没有就新建,路径类似/img/xxx.png这种)

2408.3.顶栏图标
1
favicon: /img/favicon.ico  #这里的图片最好是ico类型的小图,png也可以但是比较大的话就会不显示

3.2 参数设置

其次,是页面左上角的网页logo(图片一般是放在主目录的/source/img/下,没有就新建,路径类似/img/xxx.png这种)

2408.4.页面左上角
1
2
3
4
nav:
logo: /img/avatar.png # 图片一般是放在主目录的/source/img/下,没有就新建,路径类似/img/xxx.png这种
display_title: true # 网站标题在3.1图右边,在第二部分说到了怎么配置,默认true就ok
fixed: false # 这里我填的false,顶栏一直在的话不好看,不用固定在上面
参数 解释
logo 网站的 logo,支持图片,直接填入图片链接
display_title 是否显示网站标题,填写 true 或者 false
fixed 是否固定状态栏,填写 true 或者 false

3.3 菜单/目录

然后,是页面右上角的菜单栏

(这里我用的是阿里云矢量图标库的图标,可以看这个💮 4-2 阿里云矢量图标库

2408.5.页面右上菜单栏
1
2
3
4
5
6
7
8
9
10
menu:                                      # 注意格式  必须是/xxx/,后面||隔开,然后写图标名字
Home: / || fas fa-home # /表示返回根目录
Archives: /archives/ || fas fa-archive # /archives/表示进入根目录下的archives页面
Tags: /tags/ || fas fa-tags
Categories: /categories/ || fas fa-folder-open
List||fas fa-list: # 注意格式 必须是 ||隔开,然后写图标名字,之后跟下面的展示
Music: /music/ || fas fa-music
Movie: /movies/ || fas fa-video
Link: /link/ || fas fa-link
About: /about/ || fas fa-heart

如果不希望显示图标,可以不写图标名

(像fas fa-home就默认会链接到这个图标,不用管具体怎么连接到的,知道可以配就行了)

默认子目录是展开的(就是鼠标移过去就会展开目录),如果你想要隐藏,在子目录里添加 hide 。

1
2
3
List||fas fa-list||hide:
Music: /music/ || fas fa-music
Movie: /movies/ || fas fa-video

其中,导航栏的文字可以自行更改,例如:

1
2
3
4
5
6
7
8
9
10
11
menu:
首页: / || fas fa-home
时间轴: /archives/ || fas fa-archive
标签: /tags/ || fas fa-tags
分类: /categories/ || fas fa-folder-open
清单||fa fa-heartbeat:
音乐: /music/ || fas fa-music
照片: /Gallery/ || fas fa-images
电影: /movies/ || fas fa-video
友链: /link/ || fas fa-link
关于: /about/ || fas fa-heart
2408.6.页面右上菜单栏

4、代码(Code Blocks)

代码块中的所有功能只适用于 Hexo 自带的代码渲染

如果使用第三方的渲染器,不一定会有效

4.1 代码高亮主题

butterfly支持6中代码高亮样式:darker、pale night、light、ocean、mac、mac light

1
highlight_theme: mac light  #我觉得最好看的一个
2408.7.darker样式
2408.7.pale-night样式
2408.7.light样式
2408.7.ocean样式
2408.7.mac样式
2408.7.mac-light样式

4.2 代码复制

1
highlight_copy: true

(8)代码copy按钮

4.3 代码框展开/关闭

1
highlight_shrink: false #代码框不展开,需点击 '>' 打开(true默认不展开,false默认展开,none不显示按钮)
2408.8.代码框不展开
2408.8.代码copy按钮
2408.8.不显示按钮

4.4 代码换行

在默认情况下,Hexo 在编译的时候不会实现代码自动换行。如果你不希望在代码块的区域里有横向滚动条的话,那么你可以考虑开启这个功能。

1
code_word_wrap: true

(用到再设置)如果你是使用 highlight 渲染,需要找到你站点的 Hexo 配置文件_config.yml,将line_number改成false:

1
2
3
4
5
highlight:
enable: true
line_number: false # <- 改这里
auto_detect: false
tab_replace:

(用到再设置)如果你是使用 prismjs 渲染,需要找到你站点的 Hexo 配置文件_config.yml,将line_number改成false:

1
2
3
4
5
prismjs:
enable: false
preprocess: true
line_number: false # <- 改这里
tab_replace: ''
(10)不设置代码换行
(10)设置代码换行

4.5 代码高度限制

可配置代码高度限制,超出的部分会隐藏,并显示展开按钮。(建议打开不懂设为false)

1
highlight_height_limit: false # 我设置的是300,注意不要写单位
2408.9.限制指定行后隐藏

5、社交图标(Social Settings)

1
2
3
4
social:
fab fa-github: https://github.com/xxxx || Github || '#24292e'
fas fa-envelope: mailto:xxxx@163.com || Email || '#4a7dbe'
fa-brands fa-bilibili: https://space.bilibili.com/xxxxx || bilibili || '#ff69b4'
2408.10.社交图标

6、头像

1
2
3
avatar:
img: /img/avatar.png #主目录下的/source/img/avatar.png
effect: false #设置为true头像一直旋转(建议false)
2408.11.侧栏头像

7、 顶部图

这里所有的图都放在根目录的/source/img/文件夹下

配置 解释
index_img 主页的 top_img
default_top_img 默认的 top_img,当页面的 top_img 没有配置时,会显示 default_top_img
archive_img 归档页面的 top_img
tag_img ttag 子页面 的 默认 top_img
tag_per_img tag 子页面的 top_img,可配置每个 tag 的 top_img
category_img category 子页面 的 默认 top_img
category_per_img category 子页面的 top_img,可配置每个 category 的 top_img

主页图

2408.12.主页展示图

默认文章顶图,不设置就是这个

2408.13.文章顶部展示图

时间轴顶图/archives/

2408.14.archive时间轴展示图

标签页顶图/tags/

2408.15.tags标签页顶部图

分类页顶图/categories

2408.16.categories分类页顶图

这里是我的设置,可以参考一下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# ----------------------------------------------------------------------------
# 7、 顶部图 top_img
# ----------------------------------------------------------------------------
disable_top_img: false
index_img: /img/bg1.jpg
default_top_img: /img/rd1.jpg
archive_img: /img/rd2.jpg
tag_img: /img/rd3.jpg
# The banner image of tag page
# format:
# - tag name: xxxxx
tag_per_img:
category_img: /img/rd4.jpg
# The banner image of category page
# format:
# - category name: xxxxx
category_per_img:

8、文章封面

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
cover:
# display the cover or not (文章封面)
index_enable: true
aside_enable: true
archives_enable: true
# 封面显示的位置
# 三个值可配置 left , right , both
position: both
# 没有配置cover时候默认显示的cover图
default_cover:
- https://ruiqingyan.oss-cn-shenzhen.aliyuncs.com/RuiqyBlog/rd5.jpg
- https://ruiqingyan.oss-cn-shenzhen.aliyuncs.com/RuiqyBlog/rd6.jpg
- https://ruiqingyan.oss-cn-shenzhen.aliyuncs.com/RuiqyBlog/rd7.jpg
- https://ruiqingyan.oss-cn-shenzhen.aliyuncs.com/RuiqyBlog/rd8.jpg
- https://ruiqingyan.oss-cn-shenzhen.aliyuncs.com/RuiqyBlog/rd9.jpg

这里的cover是文章展示时候的图,就是文章展示旁边的图,不设置的话默认是sd1~sd3中的随机一个

2408.17.不设置随机顶页图

设置的话在写markdown文档的时候写上就OK

(这里的top_img是打开文章文章顶部图,cover是上图未打开文章的展示图)

2408.18.文章顶图页内设置

9、页面meta显示

这个选项是用来显示文章的相关信息的。

1
2
3
4
5
6
7
8
9
10
11
12
13
post_meta:
page:
date_type: both # created or updated or both 主页文章日期是创建日或者更新日或都显示
date_format: data # date/relative 显示日期还是相对日期
categories: true # true or false 主页是否显示分类
tags: true # true or false 主页是否显示标签
label: true # true or false 显示描述性文字
post:
date_type: both # created or updated or both 文章页日期是创建日或者更新日或都显示
date_format: data # date/relative 显示日期还是相对日期
categories: true # true or false 文章页是否显示分类
tags: true # true or false 文章页是否显示标签
label: true # true or false 显示描述性文字

主页(左边的描述信息)

2408.19.文章描述信息

文章页(上面的描述信息)

2408.20.文章内描述信息

相对时间

2408.21.文章发布时间

明确时间

2408.21.文章相对时间

10、主页文章节选(自动节选和文章页description)

图左下的文章内容描述

2408.22.文章描述信息
1
2
3
4
5
6
7
index_post_content:
# 1表示description: 只显示description
# 2表示both: 优先选择description,如果没有配置description,则显示自动节选的内容
# 3表示auto_excerpt:只显示自动节选
# 4表示false: 不显示文章内容
method: 3
length: 500 # if you set method to 2 or 3, the length need to config

11、页面锚点

开启页面锚点后,当你在进行滚动时,页面链接会根据标题ID进行替换
(注意: 每替换一次,会留下一个历史记录。所以如果一篇文章有很多锚点的话,网页的历史记录会很多。)

1
2
3
4
5
6
7
# anchor
anchor:
# when you scroll, the URL will update according to header id.
auto_update: false
# Click the headline to scroll and update the anchor
click_to_scroll: false

12、图片描述

可开启图片Figcaption描述文字显示

优先显示图片的 title 属性,然后是 alt 属性

1
photofigcaption: true
2408.23.图片下显示文字描述

13、复制相关配置

可配置网站是否可以复制、复制的内容是否添加版权信息

1
2
3
4
5
6
7
# copy settings
# copyright: Add the copyright information after copied content (複製的內容後面加上版權信息)
copy:
enable: true #是否可以复制
copyright:
enable: false #复制是否加版权
limit_count: 1000 #加版权的话字数超多多少才加

添加版权信息后

1
2
3
4
5
6
特别好用的图床工具,简单来说把本地图片变成在线url,AppStore内下载要钱,所以直接用brew下载。

作者: 花夕
链接: http://localhost:4002/2023/02/12/267/2/
来源: 花夕 & Blog
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

14、文章页相关配置

14.1 文章版权

为你的博客文章展示文章版权和许可协议。

1
2
3
4
5
6
post_copyright:
enable: true
decode: false
author_href:
license: CC BY-NC-SA 4.0
license_url: https://creativecommons.org/licenses/by-nc-sa/4.0/
2408.24.版权示例

支持在markdwon文章的front-matter配置版权信息

1
2
3
4
copyright_author: xxxx
copyright_author_href: https://xxxxxx.com
copyright_url: https://xxxxxx.com
copyright_info: 此文章版权归xxxxx所有,如有转载,请注明来自原作者

14.2 文章打赏

在你每篇文章的结尾,可以添加打赏按钮。相关二维码可以自行配置。

1
2
3
4
5
6
7
8
9
10
reward:
enable: true
text:
QR_code:
- img: /img/wechat.jpg
link:
text: 微信
- img: /img/alipay.jpg
link:
text: 支付宝
2408.25.赞助例图

14.3 TOC

在文章页,会有一个目录,用于显示TOC。

1
2
3
4
5
6
7
toc:
post: true
page: true
number: true
expand: false
style_simple: false # for post
scroll_percent: true
属性 解释
post 文章页是否显示 TOC
page 普通页面是否显示 TOC
number 是否显示章节数
expand 是否展开 TOC
style_simple 简洁模式(侧边栏只显示 TOC, 只对文章页有效 )
scroll_percent 是否显示滚动进度百分比
2408.26.PC Toc目录
2408.26.Mobile Toc目录
2408.26.设置simple样式

14.4 相关文章

1
2
3
4
related_post:
enable: true
limit: 6 # 显示推荐文章数目
date_type: created # or created or updated 文章日期显示创建日或者更新日
2408.27.相关推荐例图

14.5 文章过期提醒

设置文章过期提醒(我没用)

1
2
3
4
5
6
7
8
# Displays outdated notice for a post (文章过期提醒)
noticeOutdate:
enable: true
style: flat # style: simple/flat
limit_day: 365 # When will it be shown
position: top # position: top/bottom
message_prev: It has been
message_next: days since the last update, the content of the article may be outdated.
2408.28.文章过期

14.6 文章编辑按钮

可以理解成直接到github编辑文章,我觉得没什么用,需要的可以自行配置

1
2
3
4
5
6
7
# Post edit
# Easily browse and edit blog source code online.
post_edit:
enable: false
# url: https://github.com/user-name/repo-name/edit/branch-name/subdirectory-name/
# For example: https://github.com/jerryc127/butterfly.js.org/edit/main/source/
url:

14.7 文章分页按钮

设置分页的逻辑(推荐填2,显示的下一篇就是下一篇文章)

1
2
3
4
5
6
# post_pagination (分页)
# value: 1 || 2 || false
# 1: 下一篇显示的是旧文章
# 2: 下一篇显示的是新文章
# false: 关闭分页按钮
post_pagination: 2
2408.29.下一篇是新文章

15、Footer设置

15.1 博客年份

1
2
3
4
footer:
owner:
enable: true
since: 2023
2408.30.文章底部信息

15.2 页脚自定义文本

1
custom_text: 欢迎来的我的个人博客━(*`∀´*)ノ

当然还可以添加类似备案号、图标的内容

1
custom_text: <a href="icp链接"><img class="icp-icon" src="icp图片"><span>备案号:xxxxxx</span></a>

16、侧边栏设置(aside)

16.1 侧边排版

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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
aside:
enable: true
hide: false
button: true
mobile: true # display on mobile
position: right # left or right
display:
archive: true
tag: true
category: true
card_author:
enable: true
description:
button:
enable: true
icon: fab fa-github
text: Follow Me
link: https://github.com/xxxxxx
card_announcement:
enable: true
content: This is my Blog
card_recent_post:
enable: true
limit: 5 # if set 0 will show all
sort: date # date or updated
sort_order: # Don't modify the setting unless you know how it works
card_categories:
enable: true
limit: 8 # if set 0 will show all
expand: none # none/true/false
sort_order: # Don't modify the setting unless you know how it works
card_tags:
enable: true
limit: 40 # if set 0 will show all
color: false
orderby: random # Order of tags, random/name/length
order: 1 # Sort of order. 1, asc for ascending; -1, desc for descending
sort_order: # Don't modify the setting unless you know how it works
card_archives:
enable: true
type: monthly # yearly or monthly
format: MMMM YYYY # eg: YYYY年MM月
order: -1 # Sort of order. 1, asc for ascending; -1, desc for descending
limit: 8 # if set 0 will show all
sort_order: # Don't modify the setting unless you know how it works
card_webinfo:
enable: true
post_count: true
last_push_date: true
sort_order: # Don't modify the setting unless you know how it works
card_post_series:
enable: true
orderBy: 'date' # Order by title or date
order: -1 # Sort of order. 1, asc for ascending; -1, desc for descending

position: left

2408.31.侧栏在左边

card_tags color: false

2408.32.不显示标签颜色

card_tags color: true

2408.33.显示标签颜色

aside button

2408.34.是否显示侧栏按钮

16.2 访问人数busuanzi(UV和PV)

1
2
3
4
busuanzi:
site_uv: true
site_pv: true
page_pv: true
2408.35.访客人数

16.3 运行时间

1
2
3
4
5
6
runtimeshow:
enable: true
publish_date: 6/7/2018 00:00:00
##网页开通时间
#格式: 月/日/年 时间
#也可以写成 年/月/日 时间
2408.36.运行时间

16.4 最新评论

1
2
3
4
5
6
7
# Aside widget - Newest Comments
newest_comments:
enable: true
sort_order: # Don't modify the setting unless you know how it works
limit: 6 #数量
storage: 10 # 缓存时间,单位分钟
avatar: true # 是否显示头像

16.5 自定义添加栏目

看这篇博客:https://butterfly.js.org/posts/ea33ab97/

17、右下角按钮(Bottom right button)

17.1 简繁转换

1
2
3
4
5
6
7
8
9
10
11
12
translate:
enable: true
# 默认按钮显示文字(网站是简体,应设置为'default: 繁')
default:
#网站默认语言,1: 繁体中文, 2: 简体中文
defaultEncoding: 1
#延迟时间,若不在前, 要设定延迟翻译时间, 如100表示100ms,默认为0
translateDelay: 0
#当文字是简体时,按钮显示的文字
msgToTraditionalChinese: "繁"
#当文字是繁体时,按钮显示的文字
msgToSimplifiedChinese: "简"

17.2 阅读模式

1
readmode: true

17.3 夜间模式

1
2
3
4
5
6
7
8
9
# dark mode
darkmode:
enable: true
# dark mode和 light mode切换按钮
button: true
autoChangeMode: false # 1表示跟随系统变化,2表示按照时间变换,false表示不变换
# Set the light mode time. The value is between 0 and 24. If not set, the default value is 6 and 18
start: # 8
end: # 22

17.4滚动状态百分比

1
2
# show scroll percent in scroll-to-top button
rightside_scroll_percent: true

17.5 按钮排序

1
2
3
4
5
6
7
# Don't modify the following settings unless you know how they work (非必要请不要修改 )
# Choose: readmode,translate,darkmode,hideAside,toc,chat,comment
# Don't repeat 不要重复
rightside_item_order:
enable: false
hide: # readmode,translate,darkmode,hideAside
show: # toc,chat,comment

🌺(常用)18、标签外挂(Tag Plugins)

标签外挂是Hexo独有的功能,并不是标准的Markdown格式。

以下的写法,只适用于Butterfly主题,用在其它主题上不会有效果,甚至可能会报错。使用前请留意

18.1 Note(Bootstrap Callout)

1
2
3
4
5
6
7
8
9
10
11
12
13
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: simple
icons: false
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
3
{% note [class] [no-icon] [style] %}
Any content (support inline tags too.io).
{% endnote %}
名称 用法
class 【可选】default、primary、success、info、warning、danger
no-icon 【可选】表示不显示图标
style 【可选】simple、modern、flat、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 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 %}

默认 提示块标签

default 提示块标签

primary 提示块标签

success 提示块标签

info 提示块标签

warning 提示块标签

danger 提示块标签

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 %}

默认 提示块标签

default 提示块标签

primary 提示块标签

success 提示块标签

info 提示块标签

warning 提示块标签

danger 提示块标签

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 %}

默认 提示块标签

default 提示块标签

primary 提示块标签

success 提示块标签

info 提示块标签

warning 提示块标签

danger 提示块标签

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 %}

默认 提示块标签

default 提示块标签

primary 提示块标签

success 提示块标签

info 提示块标签

warning 提示块标签

danger 提示块标签

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 %}

默认 提示块标签

default 提示块标签

primary 提示块标签

success 提示块标签

info 提示块标签

warning 提示块标签

danger 提示块标签

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 【可选】表示不显示图标
style 【可选】simple、modern、flat、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' 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 %}

你是刷 Visa 还是 UnionPay

2021年快到了….

小心开车 安全至上

这是三片呢?还是四片?

你是刷 Visa 还是 UnionPay

剪刀石头布

前端最讨厌的浏览器

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 %}

你是刷 Visa 还是 UnionPay

2021年快到了….

小心开车 安全至上

这是三片呢?还是四片?

你是刷 Visa 还是 UnionPay

剪刀石头布

前端最讨厌的浏览器

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 %}

你是刷 Visa 还是 UnionPay

2021年快到了….

小心开车 安全至上

这是三片呢?还是四片?

你是刷 Visa 还是 UnionPay

剪刀石头布

前端最讨厌的浏览器

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 %}

你是刷 Visa 还是 UnionPay

2021年快到了….

小心开车 安全至上

这是三片呢?还是四片?

你是刷 Visa 还是 UnionPay

剪刀石头布

前端最讨厌的浏览器

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 %}

你是刷 Visa 还是 UnionPay

2021年快到了….

小心开车 安全至上

这是三片呢?还是四片?

你是刷 Visa 还是 UnionPay

剪刀石头布

前端最讨厌的浏览器

18.2 Tabs

移植与next主题,使用方法

1
2
3
4
5
6
7
8
9
10
{% tabs test  %} 
<!-- tab test1 -->
这是test1的内容
<!-- endtab -->

<!-- tab test2 -->
这是test2的内容
<!-- endtab -->

{% endtabs %}

这是test1的内容

这是test2的内容

18.3 tag-hide

请注意,tag-hide内的标签外挂content内都不建议有h1 - h6 等标题。因为Toc会把隐藏内容标题也显示出来,而且当滚动屏幕时,如果隐藏内容没有显示出来,会导致Toc的滚动出现异常。

如果想要把一些文字、内容隐藏起来,并让用于点击显示,可以使用标签外挂

inline 在文本里面添加按钮隐藏内容,只限文字

( content不能包含英文逗号,可用&sbquo;)

1
{% hideInline content,display,bg,color %}
1
2
哪个英文字母最酷? {% hideInline 因为西装裤(C装酷),查看答案,#FF7242,#fff %}
门里站着一个人? {% hideInline 闪 %}

哪个英文字母最酷? 因为西装裤(C装酷)

门里站着一个人?

block独立的block隐藏内容,可以隐藏很多内容,包括图片,代码块等等

( content不能包含英文逗号,可用&sbquo;)

1
2
3
{% hideBlock display,bg,color %}
content
{% endhideBlock %}
1
2
3
4
查看答案
{% hideBlock 查看答案 %}
傻子,怎么可能有答案
{% endhideBlock %}

查看答案

傻子,怎么可能有答案

如果你需要展示的内容太多,可以把它隐藏在收缩框里,需要时再把它展开。

( content不能包含英文逗号,可用&sbquo;)

1
2
3
{% hideToggle display,bg,color %}
content
{% endhideToggle %}
1
2
3
4
5
6
7
8
9
10
{% hideToggle 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

{% endhideToggle %}

18.4 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
3
4
5
This is my website, click the button {% btn 'https://butterfly.js.org/',Butterfly %}
This is my website, click the button {% btn 'https://butterfly.js.org/',Butterfly,far fa-hand-point-right %}
This is my website, click the button {% btn 'https://butterfly.js.org/',Butterfly,,outline %}
This is my website, click the button {% btn 'https://butterfly.js.org/',Butterfly,far fa-hand-point-right,outline %}
This is my website, click the button {% btn 'https://butterfly.js.org/',Butterfly,far fa-hand-point-right,larger %}

This is my website, click the button Butterfly
This is my website, click the button Butterfly
This is my website, click the button Butterfly
This is my website, click the button Butterfly
This is my website, click the button Butterfly

1
2
3
4
5
6
7
{% btn 'https://butterfly.js.org/',Butterfly,far fa-hand-point-right,larger %}
{% btn 'https://butterfly.js.org/',Butterfly,far fa-hand-point-right,blue larger %}
{% btn 'https://butterfly.js.org/',Butterfly,far fa-hand-point-right,pink larger %}
{% btn 'https://butterfly.js.org/',Butterfly,far fa-hand-point-right,red larger %}
{% btn 'https://butterfly.js.org/',Butterfly,far fa-hand-point-right,purple larger %}
{% btn 'https://butterfly.js.org/',Butterfly,far fa-hand-point-right,orange larger %}
{% btn 'https://butterfly.js.org/',Butterfly,far fa-hand-point-right,green larger %}

Butterfly
Butterfly
Butterfly
Butterfly
Butterfly
Butterfly
Butterfly

1
2
3
4
5
6
7
8
9
<div class="btn-center">
{% btn 'https://butterfly.js.org/',Butterfly,far fa-hand-point-right,outline larger %}
{% btn 'https://butterfly.js.org/',Butterfly,far fa-hand-point-right,outline blue larger %}
{% btn 'https://butterfly.js.org/',Butterfly,far fa-hand-point-right,outline pink larger %}
{% btn 'https://butterfly.js.org/',Butterfly,far fa-hand-point-right,outline red larger %}
{% btn 'https://butterfly.js.org/',Butterfly,far fa-hand-point-right,outline purple larger %}
{% btn 'https://butterfly.js.org/',Butterfly,far fa-hand-point-right,outline orange larger %}
{% btn 'https://butterfly.js.org/',Butterfly,far fa-hand-point-right,outline green larger %}
</div>

18.5 inlineImg 行内图

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

[src] : 图片链接
[height] : 图片高度限制【可选】
1
我觉得很漂亮 {% inlineImg https://i.loli.net/2021/03/19/5M4jUB3ynq7ePgw.png 150px %}

我觉得很漂亮

18.6 label 高亮文字

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

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

18.7 timeline

这里的color可以自选颜色blue、pink、red、purple、orange、green

1
2
3
4
5
6
7
8
{% timeline title,color %}
<!-- timeline title -->
xxxxx
<!-- endtimeline -->
<!-- timeline title -->
xxxxx
<!-- endtimeline -->
{% endtimeline %}

title

title

xxxxx

title

xxxxx

1
2
3
4
5
{% timeline 2022 %}
<!-- timeline 01-02 -->
这是测试页面
<!-- endtimeline -->
{% endtimeline %}

2022

01-02

这是测试页面

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

2022

01-02

这是测试页面

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

2022

01-02

这是测试页面

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

2022

01-02

这是测试页面

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

2022

01-02

这是测试页面

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

2022

01-02

这是测试页面

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

2022

01-02

这是测试页面

18.8 series系列文章

1
2
3
4
5
6
series:
enable: true
orderBy: 'title' # 按照日期data还是题目title
order: 1 # 1正序,-1逆序
number: true

在写markdown的front-matter时添加标签

1
series: name

之后我们在markdown文章内使用下标签生成系列文章

1
{%series name%}

这个标签会生成所有name系列相关文章的目录