_config.butterfly.yml

deploy成功但是看不到画面

注意有可能hexo generate报错,但是Github Actions的CI/CD可以通过的情况,这时候最好本地先编译预览

启动WordCount

1
2
3
# Need to install the hexo-wordcount plugin
wordcount:
enable: true

如注释中所说需要按照插件 npm install hexo-wordcount --save

配置网站流量分析功能 Microsoft Charity

Microsoft Charity - 创建项目 - 手动安装 - 复制项目代码到 microsoft_clarity: <项目代码>

1
2
3
4
5
6
7
<script type="text/javascript">
(function(c,l,a,r,i,t,y){
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "XXXXXXXXXX<项目代码>");
</script>

随后可以登录网站查看用户行为

启用本地搜索功能

  1. 修改配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
search:
# Choose: algolia_search / local_search / docsearch
# leave it empty if you don't need search
use: local_search
placeholder: 搜索

# Algolia Search
algolia_search:
# Number of search results per page
hitsPerPage: 6

# 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: true
CDN:
  1. 安装搜索插件 npm install hexo-generator-searchdb --save

_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
# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://butterfly.js.org
root: /
# permalink: :year/:month/:day/:title/
permalink: posts/:abbrlink/

# abbrlink config
# 需要安装npm install hexo-abbrlink --save
abbrlink:
alg: crc32 #support crc16(default) and crc32
rep: hex #support dec(default) and hex
drafts: false #(true)Process draft,(false)Do not process draft. false(default)
# Generate categories from directory-tree
# depth: the max_depth of directory-tree you want to generate, should > 0
auto_category:
enable: false #true(default)
depth: #3(default)
over_write: false
auto_title: false #enable auto title, it can auto fill the title by path
auto_date: false #enable auto date, it can auto fill the date by time today
force: false #enable force mode,in this mode, the plugin will ignore the cache, and calc the abbrlink for every post even it already had abbrlink.



permalink_defaults:
pretty_urls:
trailing_index: false # Set to false to remove trailing 'index.html' from permalinks
trailing_html: false # Set to false to remove trailing '.html' from permalinks


# Deployment
# 安装 npm install hexo-deployer-git --save
deploy:
type: git
repo: git@github.com:jerryc127/butterfly-demo.git
branch: master
# other deployer

# 安装 npm install hexo-generator-search --save
search:
path: search.xml
field: post
content: true
format: html

# aplayer:
# meting: true
# asset_inject: false

# encrypt: # hexo-blog-encrypt
# 安装 npm install hexo-blog-encrypt --save
# abstract: Here's something encrypted, password is required to continue reading.
# message: Hey, password is required here.
# template: <div id="hexo-blog-encrypt" data-wpm="{{hbeWrongPassMessage}}" data-whm="{{hbeWrongHashMessage}}"><div class="hbe-input-container"><input type="password" id="hbePass" placeholder="{{hbeMessage}}" /><label>{{hbeMessage}}</label><div class="bottom-line"></div></div><script id="hbeData" type="hbeData" data-hmacdigest="{{hbeHmacDigest}}">{{hbeEncryptedData}}</script></div>
# wrong_pass_message: Oh, this is an invalid password. Check and try again, please.
# wrong_hash_message: Oh, these decrypted content cannot be verified, but you can still have a look.

# kramed:
# gfm: true
# pedantic: false
# sanitize: false
# tables: true
# breaks: true
# smartLists: true
# smartypants: true

# 安装 npm install @neilsustc/markdown-it-katex
markdown_it_plus:
plugins:
- plugin:
name: '@neilsustc/markdown-it-katex'
enable: true
options:
strict: false
# 安装 npm install hexo-autonofollow --save
feed:
type: atom
path: atom.xml
limit: 0
# 安装 npm install hexo-generator-feed --save
nofollow:
enable: true
field: site
exclude:
# npm install hexo-generator-sitemap --save
sitemap:
path: sitemap.xml
rel: false
tags: true
categories: true

marked:
smartypants: false
descriptionLists: false

# server:
# port: 3127