参考:

首页设置

首页副标题设置

在 _config.butterfly.yml 中添加 subtitle 配置项,即可自定义副标题。

1
2
3
4
5
6
7
8
9
subtitle:
enable: true # 是否启用副标题
# Typewriter Effect
effect: true # 是否启用打字机效果
loop: true # 是否循环播放打字机效果
source: true
sub:
- '<i class="fas fa-quote-left"></i> just do it' # 自定义副标题1
- '<i class="fas fa-quote-left"></i> hello everybody' # 自定义副标题2

首页顶层图片设置

在 _config.butterfly.yml 中添加 index_img 配置项,即可自定义首页顶层banner图片。

1
index_img: img/1.jpg     # 自定义首页顶层banner图片

头像设置

在 _config.butterfly.yml 中添加 avatar 配置项,即可自定义头像。

1
2
3
avatar:
img: img/1.jpg # 头像图片路径
effect: false

搜索栏设置

下载插件:hexo-generator-search

1
npm install hexo-generator-search --save

在 _config.butterfly.yml 中添加 search 配置项,即可自定义搜索栏。
参考:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
search:
# Choose: algolia_search / local_search / docsearch
# leave it empty if you don't need search
use: local_search # 重点
placeholder:

# Local Search
local_search:
# Preload the search data when the page loads.
preload: true # 是否预加载搜索数据
# Show top n results per article, show all results by setting to -1
top_n_per_article: 1
# Unescape html strings to the readable one.
unescape: false
# Enable pagination for search results
pagination:
enable: true # 是否启用分页
# Number of search results per page
hitsPerPage: 8 # 每页显示8条搜索结果

文章设置

隐藏指定文章目录序号

如果只想单独关闭某一篇文章的目录序号,在该文章 .md 文件的 Front-matter 中添加:

1
2
3
4
5
---
title: 文章标题
date: 2026-05-07
toc_number: false # 仅本篇关闭目录序号
---

文章摘要

在 _config.butterfly.yml 中添加 index_post_content 配置项,即可自定义文章摘要。

1
2
3
4
index_post_content:
method: 2
# If you set method to 2 or 3, the length need to config
length: 500
  1. method: 1
    只显示 Front-Matter 里的 description
    没写 description → 不显示简介
  2. method: 2(混合模式)
    有 description → 用 description
    没有 → 自动截取正文前 N 字(length 控制)
  3. method: 3(默认)
    永远自动截取正文
    忽略 description,直接取文章开头

在文章 .md 文件的 Front-matter 中添加 description 配置项,即可自定义文章摘要。

1
2
3
4
5
---
title: 文章标题
date: 2026-05-07
description: 文章摘要
---