配置butterfly时总结出来的的经验

  1. 一步一步配,每配一次,hexo s一次,出问题了就查
  2. 出现报错的情况下,可以先试着hexo clean&hexo g&hexo s多来几次

我的文件结构注意事项

  1. 在hexo根目录下的_config.yml和_config.butterfly.yml
  2. 没有特别提到的话,数据相关文件应该都是在/source/里面
  3. 文章的创建用hexo new "name",页面的创建用的hexo new page

用代码说话,两个配置文件最容易出问题

_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
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
# 如果你用vs编程发现最后主页中文是乱码,
#是因为vs默认生成的文件不按照utf-8,请按照这个解决 https://blog.csdn.net/qq_41868108/article/details/105750175
#浏览器图标修改
favicon: /image/luogic.jpg
#导航栏设置 最上面的一栏,logo是最左边的小圈圈
nav:
logo: /image/微信图片_202406231044301.jpg
display_title: true
fixed: false # fixed navigation bar
post_asset_folder: true

#这里是右上角的设置 格式是,/文件夹路劲/|| fas图标
#(一定要建立文件夹,不如找不到会报错)
#这里的fas图标 它用的是一个公司发行的标准图标图
menu:
首页: / || fas fa-home
分类: /categories/ || fas fa-folder-open
时间轴: /archives/ || fas fa-archive
标签: /tags/ || fas fa-tags
其他||fa fa-heartbeat:
音乐: /music/ || fas fa-music
照片: /Gallery/ || fas fa-images
电影: /movies/ || fas fa-video

#网站副标题,中间标题下面一点点
# 主页subtitle
subtitle:
enable: true
# Typewriter Effect (打字效果)
effect: true
startDelay: 300 # time before typing starts in milliseconds
typeSpeed: 200 # type speed in milliseconds
backSpeed: 800 # backspacing speed in milliseconds
# loop (循环打字)
loop: true
# source 调用三方服务
# source: false 开关调用
# subtitle 会先显示 source , 再显示 sub 的內容
source: true
# 如果关闭打字效果,subtitle 只会显示 sub 的第一行文字
sub:
- 飒飒西风满院栽,蕊寒香冷蝶难来
- 他年我若为青帝,报与桃花一处开

#页面 右侧个人信息相关的设置
#头像 如果报错或者显示的是吃豆小人,检查你的名称,一定要正确
avatar:
img: /image/luogic.jpg
#effect: true # 头像会一直转,转的贼快,太鬼畜了(emmm,超级抽象,别设置

#顶部图片设置,就是主页的那张背景图,建议设置400px,默认的全屏容易让人找不到博客在哪里
#
index_img: /image/流萤.jpg
default_top_img: /image/流萤.jpg
index_top_img_height: #顶部图高度

#背景动态
canvas_fluttering_ribbon:
enable: true
mobile: false # false 手机端不显示 true 手机端显示


#页面加载动画
#加载动画
preloader:
enable: true
source: 1 #可选值1=fullpage或2=progress bar,可查看https://codebyzach.github.io/pace/
pace_css_url:

#池塘养鱼(最底部)+渐变色
inject:
head:
- <script src="/styles/fish.js"></script>
- <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
- <link rel="stylesheet" href="/styles/main.css">
bottom:
- <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
- <script src="https://cdn.jsdelivr.net/gh/xiabo2/CDN@latest/fishes.js"></script>

#搜索功能
# Local search
local_search:
enable: true
# Preload the search data when the page loads.
preload: false
# Show top n results per article, show all results by setting to -1
top_n_per_article: 3
# Unescape html strings to the readable one.
unescape: false
CDN:
#数学公式支持
katex:
enable: true
# true 表示每一页都加载katex.js
# false 需要时加载,须在使用的Markdown Front-matter 加上 katex: true
per_page: false
hide_scrollbar: true

_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
115
116
117
118
119
120
# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/

# Site
title: 龙锦
subtitle: ''
description: '买不起茅台 '
keywords:
author: 龙金伟
language: zh-CN
timezone: ''

# URL
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
url: https://username.github.io
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

# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:

# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link:
enable: true # Open external links in new tab
field: site # Apply to the whole site
exclude: ''
filename_case: 0
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:
preprocess: true
line_number: true
tab_replace: ''

# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:
path: ''
per_page: 10
order_by: -date

# 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'

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

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

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: butterfly


# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
# deploy:
# type: ''
deploy:
type: git
repo: https://github.com/longjinw/longjinw.github.io.git
branch: main
# message: Site updated: {{ now('YYYY-MM-DD HH:mm:ss') }})
#搜索
search:
path: search.xml
field: post
content: true
format: html
#数学支chi
markdown:
plugins:
- '@renbaoshuo/markdown-it-katex'