介绍一些博客的 Hexo & butterfly 配置修改方法

在主页中看到的文章内容的简介,butterfly 共提供了四种选择:

  1. description: 只显示description
  2. both: 优先选择description;如果没有配置description,则显示文章节选内容
  3. auto_excerpt: 只显示文章节选内容
  4. false: 不显示文章内容

_config.butterfly.yml 修改条目如下:

1
2
3
index_post_content:
method: 2
length: 500 # if you set method to 2 or 3, the length need to config

hexo会自动把source下的文件识别渲染为博客页面,但有时我们并不希望自动渲染,而是想要其维持我们设计的界面。

_config.yml 修改条目如下:

1
2
skip_render:
- "html/**" # "**":通配符,html文件夹下的所有文件;"*",html文件夹下一层的所有文件

_config.butterfly.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
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/Anti-Entrophic
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

social:
# fab fa-github: https://github.com/Anti-Entrophic || Github || '#24292e'

aside 的注释很详细,对照着看就知道功能了。social 指的是在 Follow me 下面出现的图标。