简洁却不简单,是一直以来我对博客的核心需求,NexT 主题侧重简洁,Butterfly 主题则侧重不简单,Butterfly 主题的博客我决定作为自己的主页。

本文对于文件(代码)变动的描述方式为第一行说明本行为相关文件的哪一行(如果没有这行描述,则本行即为第一行),-指删掉改行,+指增加改行(如果你是直接复制此行,请注意删掉+和上下文对齐)。另外,本文对于文件(代码)变动的描述只针对当时的文件(代码)版本,请根据实际情况决定对自己的相应文件(代码)进行变动。

搭建

本部分参照我的博客的诞生(一)进行。

登录 GitHub,新建一个公开仓库,仓库名设定为我的主页域名,即 www.imql.life。

登录 Gitee,新建一个公开仓库,仓库名也是设定为我的主页域名,即 www.imql.life。

再新建文件夹 www,作为<博客构建目录>,进入<博客构建目录>,进入终端,执行hexo init进行初始化。

安装 Git 插件:

1
npm install --save hexo-deployer-git

编辑 Hexo 的配置文件:

1
2
3
4
5
# 本行为<博客构建目录>\_config.yml的第102行(随着Hexo的不断更新,本行对应在你的_config.yml中不一定是第102行,请以实际情况为准)
# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
- type: ''
1
2
3
4
5
6
7
8
# 本行为<博客构建目录>\_config.yml的第102行(随着Hexo的不断更新,本行对应在你的_config.yml中不一定是第102行,请以实际情况为准)
# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
+ type: git
+ repo:
+ github: git@github.com:ql-isaac/www.imql.life.git,master
+ gitee: git@gitee.com:ql-isaac/www.imql.life.git,master

在终端输入 hexo g -d,回车,进行博客的最终操作——生成静态文件后立即部署到仓库中。

之后就是部署至 Vercel 和 Webify,实现境内境外双线部署。

Hexo 的个性化设置和配置

Butterfly 主题的下载和设置

在<博客构建目录>下进入终端,输入如下命令,等待 Butterfly 下载到当前文件夹下 themes 下 butterfly 下。

1
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly

下载完成后,编辑 Hexo 的配置文件:

1
2
3
4
5
# 本行为<博客构建目录>\_config.yml的第97行(随着Hexo的不断更新,本行对应在你的_config.yml中不一定是第97行,请以实际情况为准)
# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
-theme: landscape
1
2
3
4
5
# 本行为<博客构建目录>\_config.yml的第97行(随着Hexo的不断更新,本行对应在你的_config.yml中不一定是第97行,请以实际情况为准)
# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
+theme: butterfly

配置博客基本信息

编辑 Hexo 的配置文件,个性化配置自己的站点信息:

1
2
3
4
5
6
7
8
9
# 本行为<博客构建目录>\_config.yml的第4行(随着Hexo的不断更新,本行对应在你的_config.yml中不一定是第4行,请以实际情况为准)
# Site
-title: Hexo
-subtitle: ''
-description: ''
-keywords:
-author: John Doe
-language: en
timezone: ''
1
2
3
4
5
6
7
8
9
# 本行为<博客构建目录>\_config.yml的第4行(随着Hexo的不断更新,本行对应在你的_config.yml中不一定是第4行,请以实际情况为准)
# Site
+title: IMQL.LIFE
+subtitle: It's a beautiful day!
+description: 一尘不染不是不再有尘埃,而是尘埃让它飞扬,我自做我的阳光。
+keywords: 学习与生活
+author: ql
+language: zh-CN
timezone:

配置永久链接

配置永久链接为年月日加文章标题的英文翻译:

1
2
3
4
5
6
7
8
9
10
# 本行为<博客构建目录>\_config.yml的第13行(随着Hexo的不断更新,本行对应在你的_config.yml中不一定是第13行,请以实际情况为准)
# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
-url: http://yoursite.com
root: /
-permalink: :year/:month/:day/:title/
permalink_defaults:
pretty_urls:
trailing_index: true # Set to false to remove trailing 'index.html' from permalinks
trailing_html: true # Set to false to remove trailing '.html' from permalinks
1
2
3
4
5
6
7
8
9
10
# 本行为<博客构建目录>\_config.yml的第13行(随着Hexo的不断更新,本行对应在你的_config.yml中不一定是第13行,请以实际情况为准)
# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
+url: https://www.imql.life
root: /
+permalink: :year/:month/:day/:trans/
permalink_defaults:
pretty_urls:
trailing_index: true # Set to false to remove trailing 'index.html' from permalinks
trailing_html: true # Set to false to remove trailing '.html' from permalinks

更换默认的 Markdown 渲染器

我的博客的诞生(二)中的步骤

Butterfly 的个性化设置与配置

安装 pug 渲染插件

1
npm install hexo-renderer-pug

创建新主题配置文件

为便于对主题配置文件的管理,自 Hexo v5.0.0 开始,可以在<博客构建目录>下新建一个文件 _config..yml,此处即为 _config.butterfly.yml,然后把旧主题配置文件 _config.yml 的內容复制到 _config.butterfly.yml 去。

开启菜单

编辑 Butterfly 的配置文件:

1
2
3
4
5
6
7
8
9
10
11
# 本行为<博客构建目录>\_config.butterfly.yml的第8行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第8行,请以实际情况为准)
menu:
- # Home: / || fas fa-home
- # Archives: /archives/ || fas fa-archive
- # 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
1
2
3
4
5
6
7
8
9
10
11
# 本行为<博客构建目录>\_config.butterfly.yml的第8行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第8行,请以实际情况为准)
menu:
+ 首页: / || fas fa-home
+ 标签: /tags/ || fas fa-tags
+ 分类: /categories/ || fas fa-folder-open
+ 归档: /archives/ || fas fa-archive
+ 阅读: /books/ || fas fa-book
+ 电影: /movies/ || fas fa-video
+ 游戏: /games/ || fas fa-gamepad
+ 友链: /link/ || fas fa-link
+ #关于: /about/ || fas fa-heart

添加标签和分类页面

在<博客构建目录>下进入终端,执行如下命令。

1
hexo new page tags

编辑生成的 index.md

1
2
3
4
---
-title: tags
date: 2020-09-19 17:09:59
---
1
2
3
4
5
6
---
+title: 标签
date: 2020-09-19 17:09:59
+type: tags
+top_img: <自己图床的地址>
---

以上 top_img 指定的为标签页大图:

标签页大图.png

在<博客构建目录>下进入终端,执行如下命令。

1
hexo new page categories

编辑生成的 index.md

1
2
3
4
---
-title: categories
date: 2020-09-19 17:13:54
---
1
2
3
4
5
6
---
+title: 分类
date: 2020-09-19 17:13:54
+type: categories
+top_img: <自己图床的地址>
---

以上 top_img 指定的为分类页大图:

分类页大图·.png

编辑文章模板文件(为<博客构建目录>下 scaffolds 下 post.md):

1
2
3
4
5
6
---
title: {{ title }}
date: {{ date }}
tags:
+categories:
---

加入豆瓣页面

在<博客构建目录>下进入终端,输入如下命令安装插件 hexo-butterfly-douban。

1
npm install --save hexo-douban

编辑 Hexo 的配置文件:

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
# 本行为<博客构建目录>\_config.yml的第110行(随着Hexo的不断更新,本行对应在你的_config.yml中不一定是第110行,请以实际情况为准
+douban:
+ id: <豆瓣ID>
+ builtin: true
+ book:
+ title: <书籍页面的标题>
+ quote: <开头的引言>
+ meta: true
+ comments: true
+ top_img: <自己图床的地址>
+ aside: true
+ movie:
+ title: <电影页面的标题>
+ quote: <开头的引言>
+ meta: true
+ comments: true
+ top_img: <自己图床的地址>
+ aside: true
+ game:
+ title: <游戏页面的标题>
+ quote: <开头的引言>
+ meta: true
+ comments: true
+ top_img: <自己图床的地址>
+ aside: true
+ timeout: 10000

以上 book 下的 top_img 指定的为书籍页大图:

书籍页大图.png

以上 movie 下的 top_img 指定的为电影页大图:

电影页大图.png

以上 game 下的 top_img 指定的为游戏页大图:

游戏页大图.png

添加友链页面

在<博客构建目录>下进入终端,执行如下命令。

1
hexo new page link

编辑生成的 index.md

1
2
3
4
---
-title: links
date: 2020-09-19 17:16:16
---
1
2
3
4
5
6
---
+title: 友情链接
date: 2020-09-19 17:16:16
+type: link
+top_img: <自己图床的地址>
---

以上 top_img 指定的为友链页大图:

友链页大图.png

代码块设置

编辑 Butterfly 的配置文件:

1
2
3
4
5
6
7
# 本行为<博客构建目录>\_config.butterfly.yml的第25行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第25行,请以实际情况为准)
-highlight_theme: light # darker / pale night / light / ocean / mac / mac light / false
highlight_copy: true # copy button
highlight_lang: true # show the code language
highlight_shrink: false # true: shrink the code blocks / false: expand the code blocks | none: expand code blocks and hide the button
highlight_height_limit: false # unit: px
code_word_wrap: false
1
2
3
4
5
6
7
# 本行为<博客构建目录>\_config.butterfly.yml的第25行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第25行,请以实际情况为准)
+highlight_theme: mac light # darker / pale night / light / ocean / mac / mac light / false
highlight_copy: true # copy button
highlight_lang: true # show the code language
highlight_shrink: false # true: shrink the code blocks / false: expand the code blocks | none: expand code blocks and hide the button
highlight_height_limit: false # unit: px
code_word_wrap: false

以上设置为个人偏好,请查看主题文档相应说明确定自己的偏好。

添加社交链接

编辑 Butterfly 的配置文件,个性化添加自己的社交链接:

1
2
3
4
5
6
7
# 本行为<博客构建目录>\_config.butterfly.yml的第40行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第40行,请以实际情况为准)
# social settings (社交圖標設置)
# formal:
# icon: link || the description
social:
- # fab fa-github: https://github.com/xxxxx || Github
- # fas fa-envelope: mailto:xxxxxx@gmail.com || Email
1
2
3
4
5
6
7
# 本行为<博客构建目录>\_config.butterfly.yml的第40行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第40行,请以实际情况为准)
# social settings (社交圖標設置)
# formal:
# icon: link || the description
social:
+ fab fa-github: https://github.com/ql-isaac || Github
+ fas fa-envelope: mailto:834471527@qq.com || Email

添加搜索功能

在<博客构建目录>下进入终端,输入如下命令安装 hexo-generator-search。

1
npm install --save hexo-generator-search

开启搜索功能:

1
2
3
4
# 本行为<博客构建目录>\_config.butterfly.yml的第56行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第56行,请以实际情况为准)
# Local search
local_search:
- enable: false
1
2
3
4
# 本行为<博客构建目录>\_config.butterfly.yml的第56行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第56行,请以实际情况为准)
# Local search
local_search:
+ enable: true

配置站点图标

编辑 Butterfly 的配置文件:

1
2
3
# 本行为<博客构建目录>\_config.butterfly.yml的第81行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第81行,请以实际情况为准)
# Favicon(網站圖標)
-favicon: /img/favicon.png
1
2
3
# 本行为<博客构建目录>\_config.butterfly.yml的第81行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第81行,请以实际情况为准)
# Favicon(網站圖標)
+favicon: <自己图床的地址或者本地地址>

效果图:

配置站点图标.png

头像

编辑 Butterfly 的配置文件:

1
2
3
4
5
# 本行为<博客构建目录>\_config.butterfly.yml的第84行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第84行,请以实际情况为准)
# Avatar (頭像)
avatar:
- img: https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png
effect: false
1
2
3
4
5
# 本行为<博客构建目录>\_config.butterfly.yml的第84行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第84行,请以实际情况为准)
# Avatar (頭像)
avatar:
+ img: <自己图床的地址或者本地地址>
effect: false

首页大图

编辑 Butterfly 的配置文件:

1
2
3
# 本行为<博客构建目录>\_config.butterfly.yml的第92行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第92行,请以实际情况为准)
# The banner image of home page
-index_img:
1
2
3
# 本行为<博客构建目录>\_config.butterfly.yml的第92行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第92行,请以实际情况为准)
# The banner image of home page
+index_img: <自己图床的地址或者本地地址>

效果图:

首页大图.png

归档页大图

编辑 Butterfly 的配置文件:

1
2
3
# 本行为<博客构建目录>\_config.butterfly.yml的第98行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第98行,请以实际情况为准)
# The banner image of archive page
-archive_img:
1
2
3
# 本行为<博客构建目录>\_config.butterfly.yml的第98行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第98行,请以实际情况为准)
# The banner image of archive page
+archive_img: <自己图床的地址或者本地地址>

效果图:

归档页大图.png

子标签页大图

编辑 Butterfly 的配置文件:

1
2
3
4
# 本行为<博客构建目录>\_config.butterfly.yml的第101行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第101行,请以实际情况为准)
# If the banner of tag page not setting, it will show the top_img
# note: tag page, not tags page (子標籤頁面的 top_img)
-tag_img:
1
2
3
4
# 本行为<博客构建目录>\_config.butterfly.yml的第101行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第101行,请以实际情况为准)
# If the banner of tag page not setting, it will show the top_img
# note: tag page, not tags page (子標籤頁面的 top_img)
+tag_img: <自己图床的地址或者本地地址>

效果图:

子标签页大图.png

注意和标签页大图的区分。

子分类页大图

编辑 Butterfly 的配置文件:

1
2
3
4
# 本行为<博客构建目录>\_config.butterfly.yml的第110行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第110行,请以实际情况为准)
# If the banner of category page not setting, it will show the top_img
# note: category page, not categories page (子分類頁面的 top_img)
-category_img:
1
2
3
4
# 本行为<博客构建目录>\_config.butterfly.yml的第110行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第110行,请以实际情况为准)
# If the banner of category page not setting, it will show the top_img
# note: category page, not categories page (子分類頁面的 top_img)
+category_img: <自己图床的地址或者本地地址>

效果图:

子分类页大图.png

注意和分类页大图的区分。

启用 404 页面

1
2
3
4
5
6
# 本行为<博客构建目录>\_config.butterfly.yml的第136行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第136行,请以实际情况为准)
# A simple 404 page
error_404:
- enable: false
subtitle: 'Page Not Found'
background: https://i.loli.net/2020/05/19/aKOcLiyPl2JQdFD.png
1
2
3
4
5
6
# 本行为<博客构建目录>\_config.butterfly.yml的第136行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第136行,请以实际情况为准)
# A simple 404 page
error_404:
+ enable: true
subtitle: 'Page Not Found'
background: https://i.loli.net/2020/05/19/aKOcLiyPl2JQdFD.png

本地预览时,访问出错的网站是不会跳到 404 页面的。如需本地预览,请直接访问

文章信息显示

编辑 Butterfly 的配置文件:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 本行为<博客构建目录>\_config.butterfly.yml的第142行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第142行,请以实际情况为准)
post_meta:
page: # Home Page
date_type: created # created or updated or both 主頁文章日期是創建日或者更新日或都顯示
date_format: date # date/relative 顯示日期還是相對日期
categories: true # true or false 主頁是否顯示分類
- tags: false # true or false 主頁是否顯示標籤
label: true # true or false 顯示描述性文字
post:
date_type: both # created or updated or both 文章頁日期是創建日或者更新日或都顯示
date_format: date # date/relative 顯示日期還是相對日期
categories: true # true or false 文章頁是否顯示分類
tags: true # true or false 文章頁是否顯示標籤
label: true # true or false 顯示描述性文字
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 本行为<博客构建目录>\_config.butterfly.yml的第142行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第142行,请以实际情况为准)
post_meta:
page: # Home Page
date_type: created # created or updated or both 主頁文章日期是創建日或者更新日或都顯示
date_format: date # 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: date # date/relative 顯示日期還是相對日期
categories: true # true or false 文章頁是否顯示分類
tags: true # true or false 文章頁是否顯示標籤
label: true # true or false 顯示描述性文字

以上设置为个人偏好,请查看主题文档相应说明确定自己的偏好。

开启字数统计和阅读时间

在<博客构建目录>下进入终端,输入如下命令安装插件 hexo-wordcount。

1
npm install --save hexo-wordcount

编辑 Butterfly 的配置文件:

1
2
3
4
5
6
7
# 本行为<博客构建目录>\_config.butterfly.yml的第156行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第156行,请以实际情况为准)
# wordcount (字數統計)
wordcount:
- enable: false
post_wordcount: true
min2read: true
total_wordcount: true
1
2
3
4
5
6
7
# 本行为<博客构建目录>\_config.butterfly.yml的第156行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第156行,请以实际情况为准)
# wordcount (字數統計)
wordcount:
+ enable: true
post_wordcount: true
min2read: true
total_wordcount: true

关闭主页文章节选

编辑 Butterfly 的配置文件:

1
2
3
4
5
6
7
8
9
# 本行为<博客构建目录>\_config.butterfly.yml的第163行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第163行,请以实际情况为准)
# Display the article introduction on homepage
# 1: description
# 2: both (if the description exists, it will show description, or show the auto_excerpt)
# 3: auto_excerpt (default)
# false: do not show the article introduction
index_post_content:
- method: 3
length: 500 # if you set method to 2 or 3, the length need to config
1
2
3
4
5
6
7
8
9
# 本行为<博客构建目录>\_config.butterfly.yml的第163行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第163行,请以实际情况为准)
# Display the article introduction on homepage
# 1: description
# 2: both (if the description exists, it will show description, or show the auto_excerpt)
# 3: auto_excerpt (default)
# false: do not show the article introduction
index_post_content:
+ method: false
length: 500 # if you set method to 2 or 3, the length need to config

文章打賞

在你每篇文章的結尾,添加打賞按鈕和相应收款二维码。编辑 Butterfly 的配置文件:

1
2
3
4
5
6
7
8
9
10
11
# 本行为<博客构建目录>\_config.butterfly.yml的第187行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第187行,请以实际情况为准)
# Sponsor/reward
reward:
- enable: false
QR_code:
- # - img: /img/wechat.jpg
- # link:
- # text: wechat
- # - img: /img/alipay.jpg
- # link:
- # text: alipay
1
2
3
4
5
6
7
8
9
10
11
# 本行为<博客构建目录>\_config.butterfly.yml的第187行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第187行,请以实际情况为准)
# Sponsor/reward
reward:
+ enable: true
QR_code:
+ - img: <自己微信赞赏码的地址>
+ link:
+ text: WeChat
+ - img: <自己支付宝收钱码的地址>
+ link:
+ text: Alipay

集成在线编辑

编辑 Butterfly 的配置文件:

1
2
3
4
5
6
7
8
# 本行为<博客构建目录>\_config.butterfly.yml的第198行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第198行,请以实际情况为准)
# 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:
1
2
3
4
5
6
7
8
# 本行为<博客构建目录>\_config.butterfly.yml的第198行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第198行,请以实际情况为准)
# Post edit
# Easily browse and edit blog source code online.
post_edit:
+ enable: true
# 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: https://github.dev/ql-isaac/www#

开启图片描述

1
2
3
# 本行为<博客构建目录>\_config.butterfly.yml的第212行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第212行,请以实际情况为准)
# figcaption (圖片描述文字)
-photofigcaption: false
1
2
3
# 本行为<博客构建目录>\_config.butterfly.yml的第212行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第212行,请以实际情况为准)
# figcaption (圖片描述文字)
+photofigcaption: true

上一篇下一篇

每篇文章结束,都有上一篇下一篇的提示,默认下一篇是旧文章,上一篇是新文章,我们设置成下一篇是新文章,上一篇是旧文章。编辑 Butterfly 的配置文件:

1
2
3
4
5
6
7
# 本行为<博客构建目录>\_config.butterfly.yml的第215行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第215行,请以实际情况为准)
# post_pagination (分頁)
# value: 1 || 2 || false
# 1: The 'next post' will link to old post
# 2: The 'next post' will link to new post
# false: disable pagination
-post_pagination: 1
1
2
3
4
5
6
7
# 本行为<博客构建目录>\_config.butterfly.yml的第215行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第215行,请以实际情况为准)
# post_pagination (分頁)
# value: 1 || 2 || false
# 1: The 'next post' will link to old post
# 2: The 'next post' will link to new post
# false: disable pagination
+post_pagination: 2

开启文章锚点

当浏览文章时,文章链接会根据标题进行更新,方便我们对文章内容进行准确的引用。编辑 Butterfly 的配置文件:

1
2
3
4
# 本行为<博客构建目录>\_config.butterfly.yml的第222行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第222行,请以实际情况为准)
# anchor
# when you scroll in post, the URL will update according to header id.
-anchor: false
1
2
3
4
# 本行为<博客构建目录>\_config.butterfly.yml的第222行(随着Butterfly的不断更新,本行对应在你的_config.butterfly.yml中不一定是第222行,请以实际情况为准)
# anchor
# when you scroll in post, the URL will update according to header id.
+anchor: true