惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

A
Arctic Wolf
有赞技术团队
有赞技术团队
H
Help Net Security
N
Netflix TechBlog - Medium
G
Google Developers Blog
GbyAI
GbyAI
Jina AI
Jina AI
D
DataBreaches.Net
博客园 - Franky
Recent Announcements
Recent Announcements
博客园 - 叶小钗
大猫的无限游戏
大猫的无限游戏
N
News | PayPal Newsroom
S
SegmentFault 最新的问题
B
Blog RSS Feed
Google DeepMind News
Google DeepMind News
S
Schneier on Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
AWS News Blog
AWS News Blog
V
V2EX
月光博客
月光博客
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 【当耐特】
P
Privacy International News Feed
T
The Exploit Database - CXSecurity.com
云风的 BLOG
云风的 BLOG
F
Full Disclosure
Microsoft Security Blog
Microsoft Security Blog
MongoDB | Blog
MongoDB | Blog
V
Vulnerabilities – Threatpost
C
CERT Recently Published Vulnerability Notes
人人都是产品经理
人人都是产品经理
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
爱范儿
爱范儿
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Privacy & Cybersecurity Law Blog
G
GRAHAM CLULEY
Spread Privacy
Spread Privacy
罗磊的独立博客
P
Proofpoint News Feed
The Last Watchdog
The Last Watchdog
S
Secure Thoughts
O
OpenAI News
P
Palo Alto Networks Blog
The Cloudflare Blog
Microsoft Azure Blog
Microsoft Azure Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
Tenable Blog
雷峰网
雷峰网
C
Cisco Blogs

Butterfly

Butterfly 5.6 Release Notes Butterfly 5.5 Release Notes Butterfly 5.4 Release Notes Butterfly 5.3 Release Notes Butterfly 5.2 Release Notes Butterfly 5.1 Release Notes Butterfly 5.0 Release Notes Butterfly 4.13 Release Notes Butterfly 4.12 Release Notes Butterfly 4.11 Release Notes Butterfly 4.10 Release Notes Butterfly Changelog Butterfly document - Advanced Tutorial Butterfly document - Q&A Butterfly document - Tag Plugins Butterfly document - Theme Pages Butterfly document - Get Started Custom Sidebar When Setting top_img to false Customize code coloring no cover Tag Plugins Markdown Style test
Butterfly document - Theme Configuration
Jerry · 2023-06-30 · via Butterfly

This article is translated from ChatGPT.


Quick Read of Configuration Files

You can quickly understand all the configuration comments, making your configuration files more convenient. If you encounter any unclear configurations, you can find more detailed information in this article.

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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065











nav:

logo:
display_title: true
display_post_title: true

fixed: false

menu:









code_blocks:

theme: light
macStyle: false

height_limit: false
word_wrap: false


copy: true
language: true

shrink: false
fullpage: false




social:







favicon: /img/favicon.png

avatar:
img: /img/butterfly-icon.png
effect: false


disable_top_img: false


default_top_img:


index_img:


archive_img:


tag_img:




tag_per_img:


category_img:




category_per_img:


footer_img: false



background:

cover:

index_enable: true
aside_enable: true
archives_enable: true

default_cover:



error_img:
flink: /img/friend_404.gif
post_page: /img/404.jpg


error_404:
enable: false
subtitle: 'Page Not Found'
background: /img/error-page.png

post_meta:

page:

date_type: created

date_format: date
categories: true
tags: false
label: true
post:

position: left

date_type: both

date_format: date
categories: true
tags: true
label: true








index_site_info_top:

index_top_img_height:


subtitle:
enable: false

effect: true


typed_option:







source: false

sub:









index_layout: 3






index_post_content:
method: 3

length: 500





toc:
post: true
page: false
number: true
expand: false

style_simple: false
scroll_percent: true

post_copyright:
enable: true
decode: false
author_href:
license: CC BY-NC-SA 4.0
license_url: https://creativecommons.org/licenses/by-nc-sa/4.0/


reward:
enable: false
text:
QR_code:









post_edit:
enable: false


url:


related_post:
enable: true

limit: 6

date_type: created





post_pagination: 1


noticeOutdate:
enable: false

style: flat

limit_day: 365

position: top
message_prev: It has been
message_next: days since the last update, the content of the article may be outdated.




footer:
nav:
owner:
enable: true
since: 2019
custom_text:

copyright:
enable: true
version: true





aside:
enable: true
hide: false

button: true
mobile: true

position: 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/xxxxxx
card_announcement:
enable: true
content: This is my Blog
card_recent_post:
enable: true

limit: 5

sort: date
sort_order:
card_newest_comments:
enable: false
sort_order:
limit: 6

storage: 10
avatar: true
card_categories:
enable: true

limit: 8

expand: none
sort_order:
card_tags:
enable: true

limit: 40
color: false

orderby: random

order: 1
sort_order:
card_archives:
enable: true

type: monthly

format: MMMM YYYY

order: -1

limit: 8
sort_order:
card_post_series:
enable: true

series_title: false

orderBy: 'date'

order: -1
card_webinfo:
enable: true
post_count: true
last_push_date: true
sort_order:



runtime_date:






rightside_bottom:


translate:
enable: false

default:

defaultEncoding: 2

translateDelay: 0

msgToTraditionalChinese: '繁'

msgToSimplifiedChinese: '簡'


readmode: true


darkmode:
enable: true

button: true




autoChangeMode: false

start:
end:


rightside_scroll_percent: false




rightside_item_order:
enable: false

hide:

show:


rightside_config_animation: true





anchor:

auto_update: false

click_to_scroll: false

photofigcaption: false

copy:
enable: true

copyright:
enable: false
limit_count: 150


wordcount:
enable: false

post_wordcount: true

min2read: true

total_wordcount: true


busuanzi:
site_uv: true
site_pv: true
page_pv: true








math:


use:
per_page: true
hide_scrollbar: false

mathjax:

enableMenu: true

tags: none

katex:

copy_tex: false





search:


use:
placeholder:


algolia_search:

hitsPerPage: 6


local_search:

preload: false

top_n_per_article: 1

unescape: false
CDN:



docsearch:
appId:
apiKey:
indexName:
option:





share:


use: sharejs



sharejs:
sites: facebook,twitter,wechat,weibo,qq



addtoany:
item: facebook,twitter,wechat,sina_weibo,facebook_messenger,email,copy_link





comments:




use:

text: true


lazyload: false

count: false

card_post_count: false



disqus:
shortname:

apikey:



disqusjs:
shortname:
apikey:
option:



livere:
uid:



gitalk:
client_id:
client_secret:
repo:
owner:
admin:
option:



valine:
appId:
appKey:
avatar: monsterid

serverURLs:
bg:

visitor: false
option:



waline:
serverURL:
bg:

pageview: false
option:



utterances:
repo:

issue_term: pathname

light_theme: github-light
dark_theme: photon-dark
js:
option:



facebook_comments:
app_id:

user_id:
pageSize: 10

order_by: social
lang: zh_TW



twikoo:
envId:
region:

visitor: false
option:



giscus:
repo:
repo_id:
category_id:
light_theme: light
dark_theme: dark
js:
option:



remark42:
host:
siteId:
option:



artalk:
server:
site:

visitor: false
option:





chat:


use:


rightside_button: false

button_hide_show: false


chatra:
id:


tidio:
public_key:


crisp:
website_id:






baidu_analytics:


google_analytics:


cloudflare_analytics:


microsoft_clarity:


umami_analytics:
enable: false

serverURL:
website_id:
option:
UV_PV:
site_uv: false
site_pv: false
page_pv: false

token:


google_tag_manager:
tag_id:
domain:






google_adsense:
enable: false
auto_ads: true
js: https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js
client:
enable_page_level_ads: true



ad:

index:

aside:

post:





site_verification:

































category_ui:
tag_ui:


rounded_corners_ui: true


text_align_justify: false


mask:
header: true
footer: true


preloader:
enable: false



source: 1

pace_css_url:


enter_transitions: true


display_mode: light


beautify:
enable: false

field: post

title_prefix_icon:

title_prefix_icon_color:



font:
global_font_size:
code_font_size:
font_family:
code_font_family:


blog_title_font:
font_link:
font_family:


hr_icon:
enable: true

icon:
icon_top:



activate_power_mode:
enable: false
colorful: true
shake: true
mobile: false






canvas_ribbon:
enable: false

size: 150

alpha: 0.6
zIndex: -1
click_to_change: false
mobile: false


canvas_fluttering_ribbon:
enable: false
mobile: false



canvas_nest:
enable: false

color: '0,0,255'

opacity: 0.7

zIndex: -1

count: 99
mobile: false


fireworks:
enable: false
zIndex: 9999
mobile: false


click_heart:
enable: false
mobile: false


clickShowText:
enable: false
text:



fontSize: 15px
random: false
mobile: false









lightbox:






series:
enable: false

orderBy: 'title'

order: 1
number: true



abcjs:
enable: false
per_page: true



mermaid:
enable: false

code_write: false

theme:
light: default
dark: dark



chartjs:
enable: false



fontColor:
light: "rgba(0, 0, 0, 0.8)"
dark: "rgba(255, 255, 255, 0.8)"

borderColor:
light: "rgba(0, 0, 0, 0.1)"
dark: "rgba(255, 255, 255, 0.2)"

scale_ticks_backdropColor:
light: "transparent"
dark: "transparent"


note:





style: flat
icons: true
border_radius: 3


light_bg_offset: 0






pjax:
enable: false

exclude:



aplayerInject:
enable: false
per_page: true




snackbar:
enable: false
position: bottom-left

bg_light: '#49b1f5'
bg_dark: '#1f1f1f'



instantpage: false



lazyload:
enable: false

native: false

field: site
placeholder:
blur: false




pwa:
enable: false
manifest:
apple_touch_icon:
favicon_32_32:
favicon_16_16:
mask_icon:



Open_Graph_meta:
enable: true
option:










structured_data: true


css_prefix: true



inject:
head:

bottom:




CDN:




internal_provider: local
third_party_provider: jsdelivr


version: false



custom_format:

option:

Language

Modify Hexo's configuration file _config.yml

The default language is en

The theme supports the following languages:

  • default (en)
  • zh-CN (Simplified Chinese)
  • zh-TW (Traditional Chinese)
  • zh-HK (Traditional Chinese)
  • ja (Japanese)
  • ko (Korean)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19



To modify various website data, such as title, subtitle, and personal information like email, please edit Hexo's `_config.yml`

![butterfly-docs-hexo-config.png](https://oss.012700.xyz/butterfly/2024/09/butterfly-docs-hexo-config.png)





```yaml
nav:

logo: /xxxx.png
display_title: true
display_post_title: true

fixed: false
ParameterExplanation
logoThe website's logo, supports images, just input the image link
display_titleWhether to display the website title, write true or false
display_post_titleWhether to display the post title, write true or false
fixedWhether to fix the status bar, write true or false
1
2
3
4
5
6
7
8
9
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

Must be /xxx/, followed by || to separate, then write the icon name.

If you do not wish to display an icon, the icon name can be omitted.

By default, subdirectories are expanded. If you want to hide them, add hide inside the subdirectory.

1
2
3
List||fas fa-list||hide:
Music: /music/ || fas fa-music
Movie: /movies/ || fas fa-video

Note: The text of the navigation can be changed as desired.

For example:

1
2
3
4
5
6
7
8
9
10
11
menu:
Home: / || fas fa-home
Timeline: /archives/ || fas fa-archive
Tags: /tags/ || fas fa-tags
Categories: /categories/ || fas fa-folder-open
List||fa fa-heartbeat:
Music: /music/ || fas fa-music
Photos: /Gallery/ || fas fa-images
Movies: /movies/ || fas fa-video
Links: /link/ || fas fa-link
About: /about/ || fas fa-heart

hexo-theme-butterfly-doc-menu.png

Code Blocks

All features within code blocks are only applicable to Hexo's built-in code rendering.

If using a third-party renderer, it may not be effective.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
code_blocks:

theme: light
macStyle: false

height_limit: false
word_wrap: false


copy: true
language: true

shrink: false
fullpage: false
ParameterExplanation
themeCode highlight theme, options: darker / pale night / light / ocean / false
macStyleWhether to use Mac style
height_limitCode block height limit (unit: px), can be a number or false
word_wrapWhether to automatically wrap lines
copyWhether to show the copy button
languageWhether to show the language label
shrinktrue: collapse code block / false: expand code block / none: expand code block and hide button
fullpageWhether to show the full page button

Code Highlight Theme

Butterfly supports 4 types of code highlight styles:

  • darker
  • pale night
  • light
  • ocean

If you need a MacOS style code highlight, you can set macStyle to true.

Starting from version 3.0, the theme supports custom code color themes.

To learn how to create a custom theme, refer to the following article:

Custom Code Colors

Code Block Expand/Collapse

By default, code blocks are automatically expanded. You can set whether all code blocks are in a collapsed state, and they can be expanded by clicking >.

  • true All code blocks are collapsed and require clicking > to open.
  • false Code blocks are expanded and have a > click button.
  • none The > button is not displayed.
1
highlight_shrink: true 

You can also add highlight_shrink in the front-matter of the corresponding markdown file for a post/page to configure it independently.

When highlight_shrink in the theme configuration file is set to true, you can add highlight_shrink: false in the front-matter to configure the article to expand code blocks individually.

When highlight_shrink in the theme configuration file is set to false, you can add highlight_shrink: true in the front-matter to configure the article to collapse code blocks individually.

highlight_shrink: true

hexo-theme-butterfly-doc-highlight-shrink-true.png

highlight_shrink: false

hexo-theme-butterfly-doc-highlight-shrink-false.png

highlight_shrink: none

hexo-theme-butterfly-docs-highlight-shirk-none.png

Code Word Wrap

By default, Hexo does not implement automatic word wrapping for code during compilation. If you prefer not to have a horizontal scrollbar within the code block area, you might want to enable this feature.

1
code_word_wrap: true

If you are using highlight for rendering, you need to find your site's Hexo configuration file _config.yml and change line_number to false:

1
2
3
4
5
highlight:
enable: true
line_number: false
auto_detect: false
tab_replace:

If you are using prismjs for rendering, you need to find your site's Hexo configuration file _config.yml and change line_number to false:

1
2
3
4
5
prismjs:
enable: false
preprocess: true
line_number: false
tab_replace: ''

Before setting code_word_wrap

hexo-theme-butterfly-doc-code-word-wrap-before.png

After setting code_word_wrap

hexo-theme-butterfly-doc-code-word-wrap-after.png

Code Height Limit

Supported from version 3.7.0 and above

You can configure a height limit for code blocks. Any content exceeding this limit will be hidden, with a button to expand it shown.

1
highlight_height_limit: false 

Notes:

  1. The unit is px. Add a number directly, such as 200.

  2. The actual height limit is highlight_height_limit + 30 px. An additional 30px is added to the limit to avoid showing the expand button when the code height exceeds the limit by just a little, resulting in no content being shown upon expansion.

  3. This does not apply to code blocks that are hidden (with CSS display: none).

Butterfly supports font-awesome v6 icons.

The format is icon name: url || descriptive text || color

1
2
3
social:
fab fa-github: https://github.com/xxxxx || Github || "#hdhfbb"
fas fa-envelope: mailto:xxxxxx@gmail.com || Email || "#000000"

You can find the icon names here

hexo-theme-butterfly-doc-fontawesome.png

PC:

!hexo-theme-butterfly-doc-fontawesome.png

Mobile:

hexo-theme-butterfly-doc-socila-icon-mobile.png

Image Settings

Avatar

1
2
3
avatar:
img: /img/avatar.png
effect: true

hexo-theme-butterfly-doc-avatar.png

Top Image

If you do not want to display the top image, you can directly configure disable_top_img: true

The order of obtaining the top image, if none are configured, the top image will not be displayed.

  1. The order of obtaining the top image for pages:

    Individually configured top_img > default_top_img in the configuration file

  2. The order of obtaining the top image for article pages:

    Individually configured top_img > cover > default_top_img in the configuration file

Values in the configuration:

ConfigurationExplanation
index_imgTop image for the homepage
default_top_imgDefault top image, displayed when the page's top_img is not configured
archive_imgTop image for the archive page
tag_imgDefault top image for tag subpages
tag_per_imgTop image for tag subpages, can configure a top_img for each tag
category_imgDefault top image for category subpages
category_per_imgTop image for category subpages, can configure a top_img for each category

For other pages (tags/categories/custom pages) and article pages, set the top_img in the front-matter of the corresponding markdown page.

All the above top_img can be configured with the following values:

Configuration ValueEffect
Leave emptyDisplay the default top_img (if any), otherwise display the default color
(If the top_img of the article page is empty, the cover value will be displayed)
img linkLink to the image, display the configured image
Color (
HEX value - #0000FF
RGB value - rgb(0,0,255)
Color word - orange
Gradient color - linear-gradient( 135deg, #E2B0FF 10%, #9F44D3 100%)
)
Corresponding color
transparentTransparent
falseDo not display top_img

tag_per_img and category_per_img are new in version 3.2.0, allowing individual configuration for tags and categories.

It is not recommended to configure different top images for each tag and category, as too many configurations will slow down the generation speed.

1
2
3
4
5
6
7
tag_per_img:
aplayer: https://xxxxxx.png
android: ddddddd.png

category_per_img:
隨想: hdhdh.png
推薦: ddjdjdjd.png

theme-butterfly-docs-page-top-img-false.png

theme-butterfly-docs-post-top-img-false-new.png

theme-butterfly-docs-top-img-orange.png

top_img: 'linear-gradient(20deg, #0062be, #925696, #cc426e, #fb0347)'

theme-butterfly-docs-top-img-color.png

1
2

footer_img: true
Configuration ValueEffect
Leave empty/falseDisplay the default color
img linkLink to the image, display the configured image
Color (
HEX value - #0000FF
RGB value - rgb(0,0,255)
Color word - orange
Gradient color - linear-gradient( 135deg, #E2B0FF 10%, #9F44D3 100%)
)
Corresponding color
transparentTransparent
trueDisplay the same as top_img

Website Background

The default display is white, you can set an image or color

1
2
3


background:

Note: If your website root directory is not '/', when using local images, you need to add your root directory.
For example: if the website is https://yoursite.com/blog, and you reference an image img/xx.png, then set the background to /blog/img/xx.png

hexo-theme-butterfly-doc-set-body-background-color.png

hexo-theme-butterfly-doc-set-body-background-img.png

Article Cover

In the markdown document of the article, add cover in the Front-matter and fill in the image address to be displayed.

If cover is not configured, you can set a default cover to display.

If you do not want to display the cover on the homepage, you can set it to false.

The order of obtaining the article cover: Front-matter cover >default_cover in the configuration file > false

1
2
3
4
5
6
cover:

index_enable: true
aside_enable: true
archives_enable: true
default_cover:
ParameterExplanation
index_enableWhether to display the article cover on the homepage
aside_enableWhether to display the article cover in the aside
archives_enableWhether to display the article cover on the archive page
default_coverDefault cover, can configure image link/color/gradient color etc.

When multiple images are configured, one will be randomly selected as the cover. The configuration should be written as

1
2
3
4
default_cover:
- https://jsd.012700.xyz/gh/jerryc127/CDN@latest/cover/default_bg.png
- https://jsd.012700.xyz/gh/jerryc127/CDN@latest/cover/default_bg2.png
- https://jsd.012700.xyz/gh/jerryc127/CDN@latest/cover/default_bg3.png

hexo-theme-butterfly-doc-post-cover.png

hexo-theme-butterfly-doc-post-cover-show.png

hexo-theme-butterfly-docs-cover-false.png

Page Meta Display

This option is used to display related information about the article.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
post_meta:

page:

date_type: created

date_format: date
categories: true
tags: false
label: true
post:

position: left

date_type: both

date_format: date
categories: true
tags: true
label: true

Home Page:

ParameterExplanation
date_typeDisplays the article's time, options: created / updated / both
date_formatConfigures whether to show the exact time or relative time, options: date / relative
categoriesWhether to display the article's categories
tagsWhether to display the article's tags
labelWhether to display text labels

Post:

ParameterExplanation
positionPosition of the article page meta display, options: left / center
date_typeDisplays the article's time, options: created / updated / both
date_formatConfigures whether to show the exact time or relative time, options: date / relative
categoriesWhether to display the article's categories
tagsWhether to display the article's tags
labelWhether to display text labels

hexo-theme-butterfly-docs-page-meta.png

hexo-theme-butterfly-doc-post-info.png

hexo-theme-butterfly-doc-post-tag.png

date_format is a new feature in version 3.2.0, allowing configuration of displaying exact or relative time.

theme-butterfly-docs-relative-time.png

theme-butterfly-docs-full-date.png

Home Page

Home Page Top Image Size

By default, the display is full-screen, and site information is centered.

1
2
3
4
5



index_site_info_top:
index_top_img_height:

Note: The value of index_top_img_height cannot be a percentage. If both are not filled, default values will be used.

Example: when

1
index_top_img_height: 400px

Effect:

hexo-theme-butterfly-doc-index-top-img-setting.png

Website Subtitle

Set a subtitle or favorite motto to display on the home page.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

subtitle:
enable: false

effect: true


typed_option:






source: false

sub:
- Never put off till tomorrow what you can do today

hexo-theme-butterfly-doc-index-subtitle.gif

Home Page Card Layout

The theme supports seven types of card layouts for the home page

1
index_layout: 3
配置值解釋
1Cover on the left, info on the right
2Cover on the right, info on the left
3Cover and info alternate between left and right
4Cover on top, info on the bottom
5Info displayed on the cover
6Masonry layout - Cover on top, info on the bottom
7Masonry layout - Info displayed on the cover

Just fill in the number, the default is 3

1: Cover on the left, info on the right

2: Cover on the right, info on the left

3: Cover and info alternate between left and right

4: Cover on top, info on the bottom

5: Info displayed on the cover

6: Masonry layout - Cover on top, info on the bottom

7: Masonry layout - Info displayed on the cover

Home Page Article Excerpts

Due to the theme's UI, home page article excerpts only support automatic excerpts and article description.

1
2
3
4
5
6
7
8
9





index_post_content:
method: 3

length: 500
ParameterDescription
methodMethod to display article content, four options available
1 - Display only description
2 - Prefer description, if not configured, display auto excerpt
3 - Display only auto excerpt
4 - Do not display article content
lengthLength of the auto excerpt, only needs to be configured when method is 2 or 3

Add description in front-matter:

hexo-theme-butterfly-doc-post-description.png

Article Page

TOC (Table of Contents)

Display TOC (Table of Contents) in the aside.

1
2
3
4
5
6
7
8
toc:
post: true
page: false
number: true
expand: false

style_simple: false
scroll_percent: true
AttributeExplanation
postWhether to display TOC in article pages
pageWhether to display TOC in regular pages
numberWhether to show section numbers
expandWhether to expand the TOC
style_simpleSimple mode (aside only shows TOC, only for articles)
scroll_percentWhether to show scroll progress percentage

Configuring for Specific Articles

Add toc_number and toc at the top of your article's md file, and set them to true or false.

The theme will prioritize the Front-matter configuration of the article's Markdown file. If not configured, it will use the configuration in the theme configuration file.

Article Copyright

Display copyright and license information for your blog articles.

1
2
3
4
5
6
7
8
9
10
11
post_copyright:

enable: true

decode: false

author_href:

license: CC BY-NC-SA 4.0

license_url: https://creativecommons.org/licenses/by-nc-sa/4.0/

Since Hexo 4.1, URLs are decoded by default, so Chinese URLs will be decoded. Set decode: true to display Chinese URLs.

If some articles (e.g., reprints) do not need to display copyright, you can set it individually in the article's Front-matter:

1
copyright: false

From version 3.0.0, individual articles can have their own copyright information. Set it individually in the article's Front-matter:

1
2
3
4
copyright_author: xxxx
copyright_author_href: https://xxxxxx.com
copyright_url: https://xxxxxx.com
copyright_info: 此文章版權歸 xxxxx 所有,如有轉載,請註明來自原作者

Copyright Display Screenshot

Article Donations/Sponsorship

At the end of each of your articles, you can add a donation button. You can configure the relevant QR codes yourself.

For those who haven't provided QR codes, you can configure an icon image for software and add the corresponding donation link. When users click the image, they'll be redirected to the link.

The link can be omitted, and it will default to the image link.

1
2
3
4
5
6
7
8
9
10
reward:
enable: true
text:
QR_code:
- img: /img/wechat.jpg
link:
text: WeChat
- img: /img/alipay.jpg
link:
text: Alipay

Article Edit Button

Display an edit button next to the article title. When clicked, it will redirect to the corresponding link.

1
2
3
4
5
6
7


post_edit:
enable: false


url:

hexo-theme-butterfly-docs-post-edit.png

hexo-theme-butterfly-docs-post-edit-2.png

When the article cover is set to false or no cover configuration is available, the background for related articles will display the theme color.

The related articles recommendation is based on the tags associated with each article.

1
2
3
4
related_post:
enable: true
limit: 6
date_type: created

Article Pagination Buttons

When the article cover is set to false or no cover configuration is available, the background for pagination will display the theme color.

You can configure the logic for pagination or disable pagination display altogether.

1
2
3
4
5
6





post_pagination: false
ParameterExplanation
post_pagination: falseDisable pagination buttons
post_pagination: 1Next post links to older post
post_pagination: 2Next post links to newer post

Outdated Article Reminder

if you want to close the out-of-date reminder for certain articles, you can configure noticeOutdate: false in the corresponding article's front-matter to close it individually.

You can choose to display an outdated notice for articles based on their update time.

1
2
3
4
5
6
7
8
9
10
11

noticeOutdate:
enable: false

style: flat

limit_day: 365

position: top
message_prev: It has been
message_next: days since the last update, the content of the article may be outdated.
ConfigurationExplanation
enableEnable article outdated notice
styleNotice style: simple / flat
limit_daySet how many days before the notice appears (default: 365 days)
positionNotice position: top / bottom
message_prevCustom message (prefix)
message_nextCustom message (suffix)

hexo-theme-butteffly-docs-outdate-flat.png

hexo-theme-butterfly-docs-outdated-simple.png

The footer navigation bar can be configured to display at the top of the footer, or not displayed at all.

You can configure it or leave it empty.
If left empty, the old version of the footer will be shown.

Example configuration:

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
nav:
- width:
content:
- title: Docs
item:
- title: 🚀 Get Started
url: /posts/21cfbf15/
- title: 📑 Theme Pages
url: /posts/dc584b87/
- title: 📌 Theme Configuration
url: /posts/4aa8abbe/
- title: ⚔️ Tag Plugins
url: /posts/ceeb73f/
- title: Q&A
url: /posts/98d20436/
- title: ⚡️ Advanced Tutorials
url: /posts/4073eda/
- content:
- title: Others
item:
- title: Gallery
url: /Gallery/
- title: Message Board
url: /messageboard/
- title: Talking
url: /talking/
- title: Example
url: /link/
- title: Friends
url: /links/
- content:
- title: Framework
item:
- title: Hexo
url: https://hexo.io/
- title: Butterfly
url: https://butterfly.js.org/
- content:
- title: Sponsor
item:
- title: Alipay
url: https://jsd.012700.xyz/gh/jerryc127/CDN/Photo/alipay.jpg
html: "<img src='https://jsd.012700.xyz/gh/jerryc127/CDN/Photo/alipay.jpg' alt='JerryC' width='100px' height='100px'>"

Configuration explanation

OptionDescription
widthSet the width, recommended to leave unset (optional)
contentContent of the footer navigation bar, supports multiple sections, each with multiple items
titleTitle of the footer navigation bar section
itemItems in the footer navigation bar, supports multiple items, each with a title and link
titleTitle of the navigation item
urlLink of the navigation item
htmlHTML content for the navigation item, supports images and other content

Blog Start Year

The since option displays the starting year of your site. It appears at the bottom of the page.

1
2
3
4
footer:
owner:
enable: true
since: 2018

hexo-theme-butterfly-doc-since.png

The custom_text option allows you to add custom text to the footer. You can use HTML here to write statements or other content.

1
custom_text: Hi, welcome to my <a href="https://butterfly.js.org/">blog</a>!

hexo-theme-butterfly-doc-footer-text.png

For those who need to include an ICP (Internet Content Provider) number, you can also add it within the custom_text:

1
custom_text: <a href="ICP link"><img class="icp-icon" src="ICP image"><span>Record Number:xxxxxx</span></a>

Aside

Aside Configuration

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
aside:
enable: true
hide: false

button: true
mobile: true

position: 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/xxxxxx
card_announcement:
enable: true
content: This is my Blog
card_recent_post:
enable: true

limit: 5

sort: date
sort_order:
card_newest_comments:
enable: false
sort_order:
limit: 6

storage: 10
avatar: true
card_categories:
enable: true

limit: 8

expand: none
sort_order:
card_tags:
enable: true

limit: 40
color: false

orderby: random

order: 1
sort_order:
card_archives:
enable: true

type: monthly

format: MMMM YYYY

order: -1

limit: 8
sort_order:
card_post_series:
enable: true

series_title: false

orderBy: 'date'

order: -1
card_webinfo:
enable: true
post_count: true
last_push_date: true
sort_order:



runtime_date:

sort_order is used to configure the order of each card. If not configured, it will follow the order in the theme configuration file. The smaller the number, the higher its position.

ConfigurationExplanation
enableWhether to enable the sidebar
hideWhether to hide the sidebar by default
buttonWhether to show the button to hide/show the sidebar
mobileWhether to display the sidebar on mobile devices
positionSidebar position, left / right
display.archiveWhether to display aside on the archive page
display.tagWhether to display aside on the tag page
display.categoryWhether to display aside on the category page
card_author.enableWhether to display the author card
card_author.descriptionAuthor description information
card_author.button.enableWhether to display the button
card_author.button.iconButton icon, you can find the icon name here: https://fontawesome.com/icons?d=gallery&m=free
card_author.button.textButton text
card_author.button.linkButton link
card_announcement.enableWhether to display the announcement card
card_announcement.contentAnnouncement content (HTML tags can be used)
card_recent_post.enableWhether to display the recent posts card
card_recent_post.limitNumber of posts to display, 0 for all
card_recent_post.sortSorting method, date / updated
card_newest_comments.enableWhether to display the newest comments card
card_newest_comments.limitNumber of comments to display, 0 for all
card_newest_comments.storageStorage time in minutes, saved to local storage to avoid re-fetching data on every refresh
card_newest_comments.avatarWhether to display avatars
card_categories.enableWhether to display the categories card
card_categories.limitNumber of categories to display, 0 for all
card_categories.expandWhether to expand categories, none / true / false
card_tags.enableWhether to display the tags card
card_tags.limitNumber of tags to display, 0 for all
card_tags.colorWhether to display tag colors
card_tags.orderbyTag sorting method, random / name / length
card_tags.orderSorting method, 1 for ascending, -1 for descending
card_archives.enableWhether to display the archives card
card_archives.typeArchive type, monthly / yearly
card_archives.formatArchive display format, e.g., YYYY年MM月
card_archives.orderSorting method, 1 for ascending, -1 for descending
card_archives.limitNumber of archives to display, 0 for all
card_post_series.enableWhether to display the post series card
card_post_series.series_titleWhether to display the series name
card_post_series.orderBySorting method, title / date
card_post_series.orderSorting method, 1 for ascending, -1 for descending
card_webinfo.enableWhether to display the website info card
card_webinfo.post_countWhether to display the number of posts
card_webinfo.last_push_dateWhether to display the last update date
card_webinfo.runtime_dateDisplay the website runtime, no need to enable, leave blank (if enabled, the format must be Month/Day/Year Time or Year/Month/Day Time)

Currently, three comment systems - Livere, Facebook Comments, and Giscus do not support displaying the latest comments.

The latest comments are only loaded upon refreshing the page and do not update in real-time.

Due to API rate limits, to avoid excessive calls, the theme defaults to a storage duration of 10 minutes. This means, after a call, the data will be stored in localStorage, and refreshing the website within 10 minutes will only retrieve data from localStorage. After the 10-minute period, refreshing the page will call the API to load new data. (A storage configuration was added in version 3.6.0, allowing for custom cache duration settings.)

butterfly-docs-card-tags-color-false.png

butterfly-docs-card-tags-color-true.png

hexo-theme-butterfly-doc-runtime.png

Custom Add Aside Widget

Click to Visit

Bottom Right Buttons

Button Position

When the chat service is enabled, the chat service button may cover the bottom right buttons. You can set the position of these buttons. It's not recommended to adjust this unless necessary, the default is fine.

1
2

rightside_bottom:

The default unit is px, just add the number directly.

Simplified and Traditional Chinese Conversion

The theme has a built-in simple conversion function between Simplified and Traditional Chinese, using a one-to-one pairing. In cases of multiple Traditional characters for a single Simplified character or vice versa, correct conversion may not occur. Please be aware.

After enabling, there will be a Simplified/Traditional conversion button at the bottom right.

1
2
3
4
5
6
7
8
9
10
11
12
translate:
enable: true

default: Simplified

defaultEncoding: 1

translateDelay: 0

msgToTraditionalChinese: 'Traditional'

msgToSimplifiedChinese: 'Simplified'

Reading Mode

Reading mode removes content other than the article itself to avoid distractions during reading.

It only appears on article pages, with a reading mode button at the bottom right.

1
readmode: true

Dark Mode

There will be a dark mode button at the bottom right.

1
2
3
4
5
6
7
8

darkmode:
enable: true
button: true
autoChangeMode: false

start:
end:
ParameterExplanation
buttonWhether to display the day/night mode switch button at the bottom right
autoChangeModeThe mode of automatic switching
autoChangeMode: 1 Changes according to the system, browsers/systems that do not support this will switch to light mode between the start and end times
autoChangeMode: 2 Only switches to light mode between the start and end times, other times will be dark mode
autoChangeMode: false Cancels automatic switching
startThe start time for light mode
endThe end time for light mode

hexo-theme-butterfly-doc-dark-mode-1.png

Scroll Status Percentage

1
2

rightside_scroll_percent: true

Button Sorting

You can sort the buttons at the bottom right corner.

Note: Do not duplicate

1
2
3
4
5
6
7



rightside_item_order:
enable: false
hide:
show:

Global Configuration

Page Anchors

When page anchors are enabled, the page link will be updated according to the header ID as you scroll.
(Note: Each update will leave a history record. So if an article has many anchors, the web page's history record will be extensive.)

1
2
3
4
5
6

anchor:

auto_update: false

click_to_scroll: false
ParameterExplanation
auto_updateWhen scrolling, the URL will update according to the header ID. Default is false.
click_to_scrollClick the headline to scroll and update the anchor. Default is false.

Image Captions

You can enable Figcaption to display image descriptions.

It will prioritize the title attribute of the image, followed by the alt attribute.

1
photofigcaption: true

Copy Configuration

You can configure whether the website content can be copied and whether to add copyright information to the copied content.

1
2
3
4
5
6
copy:
enable: true

copyright:
enable: false
limit_count: 150
ParameterExplanation
enableWhether to enable copy permissions for the website
copyrightAdd copyright information after the copied content
enableWhether to enable adding copyright information
limit_countWord limit. When the copied text exceeds this limit, copyright information will be added to the copied content

After adding copyright information

1
2
3
4
5
6
7
Lorem ipsum dolor sit amet, test link consectetur adipiscing elit. Strong text pellentesque ligula commodo viverra vehicula. Italic text at ullamcorper enim. Morbi a euismod nibh. Underline text non elit nisl. Deleted text tristique, sem id condimentum tempus, metus lectus venenatis mauris, sit amet semper lorem felis a eros. Fusce egestas nibh at sagittis auctor. Sed ultricies ac arcu quis molestie. Donec dapibus nunc in nibh egestas, vitae volutpat sem iaculis. Curabitur sem tellus, elementum nec quam id, fermentum laoreet mi. Ut mollis ullamcorper turpis, vitae facilisis velit ultricies sit amet. Etiam laoreet dui odio, id tempus justo tincidunt id. Phasellus scelerisque nunc sed nunc ultricies accumsan.


Author: Jerry
Link: http://localhost:4000/posts/bd3c650b/#Paragraph
Source: Butterfly
Copyright belongs to the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.

Word Count

To enable the word count feature, you need to install the hexo-wordcount plugin.

Run npm install hexo-wordcount --save or yarn add hexo-wordcount in the hexo working directory.

1
2
3
4
5
6
7
8
9

wordcount:
enable: false

post_wordcount: true

min2read: true

total_wordcount: true
ParameterExplanation
post_wordcountDisplay the word count on the article page
min2readDisplay the reading time on the article page
total_wordcountDisplay the total word count of the website in the sidebar

hexo-theme-butterfly-doc-word-count.png

hexo-theme-butterfly-docs-wordcount-totalcount.png

Visitor Count (UV and PV) by busuanzi

Visit the official website of busuanzi for more information.

Due to the stability issues of busuanzi, there may be occasional access problems. Please be aware.

The visitor count on the article page is implemented through the busuanzi plugin. Some comment systems have their own visitor count feature, which can be enabled in the corresponding comment system configuration and will replace the busuanzi count.

1
2
3
4
busuanzi:
site_uv: true
site_pv: true
page_pv: true

If you need to modify the CDN link of busuanzi, you can do so through the option in the CDN section of the theme configuration file.

1
2
3
CDN:
option:
busuanzi: xxxxxxxxx

hexo-theme-butterfly-doc-busuanzi-site-pv.png

hexo-theme-butterfly-doc-pv.png

Math

The theme supports two math formula rendering engines, MathJax and KaTeX. You can choose one according to your needs.

1
2
3
4
5
6
7
8
9



math:


use:
per_page: true
hide_scrollbar: false
ParameterExplanation
useChoose the math formula rendering engine, select mathjax or katex. Leave it empty if you don't need math formulas.
per_pageWhether to load the math formula rendering engine on each page. If set to false, you need to add mathjax: true or katex: true in the article's Front-matter to load the math formula rendering engine for that article.
hide_scrollbarWhether to hide the scrollbar

Do not use MathJax syntax in titles. The TOC may not display MathJax correctly and might show MathJax code instead.

It is recommended to use KaTeX for better results, as introduced below!

To enable MathJax, set use to mathjax.

MathJax configuration file

1
2
3
4
5
mathjax:

enableMenu: true

tags: none
ParameterExplanation
enableMenuEnable the right-click menu
tagsChoose whether to number equations. all for numbering all, ams for numbering only equations, none for no numbering

Before using MathJax, you need to uninstall Hexo's markdown renderer and then install hexo-renderer-kramed.

Perform the following operations in your Hexo blog directory (not the Butterfly directory):

  1. Install the plugin

    1
    2
    npm uninstall hexo-renderer-marked --save
    npm install hexo-renderer-kramed --save
  2. Configure the Hexo root directory configuration file

    1
    2
    3
    4
    5
    6
    7
    8
    kramed:
    gfm: true
    pedantic: false
    sanitize: false
    tables: true
    breaks: true
    smartLists: true
    smartypants: true

Effect:

hexo-theme-butterfly-doc-mathjax-2.jpg

Do not use KaTeX syntax in titles. The TOC cannot display KaTeX correctly.

To enable KaTeX, set use to katex.

1
2
3
katex:

copy_tex: false
ParameterExplanation
copy_texEnable the copy KaTeX formula function

You do not need to add katex.min.js to render math equations. Instead, you need to uninstall your previous Hexo markdown renderer and then install other plugins.

Uninstall the marked plugin and install hexo-renderer-markdown-it.

1
2
3
4
5
npm un hexo-renderer-marked --save 
npm un hexo-renderer-kramed --save

npm i hexo-renderer-markdown-it --save
npm install katex @renbaoshuo/markdown-it-katex

Configure the Hexo root directory _config.yml.

1
2
3
markdown:
plugins:
- '@renbaoshuo/markdown-it-katex'

For other parameter configurations, please refer to the KaTeX official website.

Note: This method generates KaTeX without italics.

Uninstall the marked plugin and then install the new hexo-renderer-markdown-it-plus:

1
2
3
4
5
6
7
8
9
10
11


npm un hexo-renderer-marked --save



npm un hexo-renderer-kramed --save



npm i @upupming/hexo-renderer-markdown-it-plus --save

Note that hexo-renderer-markdown-it-plus is no longer maintained, so we use @upupming/hexo-renderer-markdown-it-plus. This fork uses @neilsustc/markdown-it-katex, which is also used by the VSCode plugin Markdown All in One, so we can get the latest KaTeX features such as \tag{}.

You can also control KaTeX settings through @neilsustc/markdown-it-katex. All configurable options can be found at https://katex.org/docs/options.html. For example, if you want to disable the lengthy warning messages output by KaTeX on the command line, you can use the following configuration in the root directory _config.yml to set strict to false:

1
2
3
4
5
6
7
markdown_it_plus:
plugins:
- plugin:
name: '@neilsustc/markdown-it-katex'
enable: true
options:
strict: false

Of course, you can also use this feature to define some commonly used macros.

Since KaTeX is faster and lighter, it does not have as many features as MathJax (such as the right-click menu). For those using MathJax, the theme also includes the copy function of KaTeX.

The theme supports three search methods (algolia_search / local_search / docsearch). You can choose one or multiple search methods.

1
2
3
4
5
search:


use:
placeholder:
ParameterDescription
useChoose the search method you need; leave it empty if not needed
placeholderPlaceholder text in the search box

Remember to run hexo clean

If you use hexo-algoliasearch, make sure to configure the fields parameter with title, permalink, and content.

  1. Install hexo-algolia or hexo-algoliasearch and configure according to their documentation.

  2. Set the use parameter in the theme configuration file to algolia_search.

Additional configuration:

1
2
3
4

algolia_search:

hitsPerPage: 6
ParameterDescription
hitsPerPageNumber of search results per page
  1. Run Hexo.

Remember to run hexo clean

  1. Install hexo-generator-searchdb or hexo-generator-search and configure according to their documentation.

  2. Set the use parameter in the theme configuration file to local_search.

Additional configuration:

1
2
3
4
5
6
7
8
9

local_search:

preload: false

top_n_per_article: 1

unescape: false
CDN:
ParameterDescription
preloadPreload search data on page load. If disabled, search data loads when the search button is clicked.
top_n_per_articleNumber of matched results to show per article, default is 1
unescapeUnescape HTML strings to readable text
CDNCDN URL for search data (default is local link)

DocSearch is another search service provided by Algolia. For detailed application and usage, refer to the DocSearch documentation.

  1. Apply for DocSearch and obtain your appId, apiKey, and indexName.
  2. Set the use parameter in the theme configuration file to docsearch.

Additional configuration:

1
2
3
4
5
6
7
# Docsearch
# https://docsearch.algolia.com/
docsearch:
appId:
apiKey:
indexName:
option:
ParameterDescription
appId[Required] Your Algolia application ID
apiKey[Required] Your Algolia search API key
indexName[Required] Your Algolia index name
option[Optional] Additional DocSearch configuration. Refer to the documentation for details.

hexo-theme-butterfly-docs-docsearch.png

Only one sharing service can be selected.

The theme supports two sharing methods: sharejs and addtoany.

1
2
3
4
share:


use: sharejs
ParameterDescription
useChoose the sharing method: sharejs or addtoany. Leave it empty if sharing is not needed.

If you're not familiar with sharejs, check out its documentation.

1
2
3
4


sharejs:
sites: facebook,twitter,wechat,weibo,qq

hexo-theme-butterfly-doc-sharejs.png

Refer to addtoany for usage instructions.

1
2
addtoany:
item: facebook,twitter,wechat,sina_weibo,facebook_messenger,email,copy_link

hexo-theme-butterfly-doc-addtoany.png

The theme supports multiple comment systems. You can choose one according to your preference. You can also select dual comments by configuring two comment systems (the first one will be shown by default).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
comments:




use:

text: true


lazyload: false

count: false

card_post_count: false
ParameterExplanation
useThe comment system(s) to use (note: up to two systems, leave empty if not needed).
Note: Dual comments cannot be Disqus and Disqusjs together due to shared ID conflicts.
textWhether to display the comment service name next to the button.
lazyloadWhether to enable lazyload for comments. If enabled, the comment resources will load only when the comment section enters the viewport (comment count will not be displayed if lazyload is enabled).
countWhether to display the comment count at the top of the post.
Livere, Giscus, and Utterances do not support comment count display.
card_post_countWhether to display the comment count on the homepage post cards.
Gitalk, Livere, Giscus, and Utterances do not support comment count display.

Register on Disqus, configure your Disqus settings, and then enable it in the Butterfly theme.

1
2
disqus:
shortname:
ParameterExplanation
shortnameYour Disqus shortname. You can create it here.

Similar to Disqus, but can be used to display comments when Disqus is inaccessible in mainland China. Refer to Disqusjs for details.

1
2
3
4
disqusjs:
shortname:
apikey:
option:
ParameterExplanation
shortnameYour Disqus shortname. You can create it here.
apikeyYour Disqus API Key. You can create it here.
optionOptional configuration.

Display when Disqus is inaccessible

Register on Livere, configure your Livere settings, and then enable it in the Butterfly theme.

1
2
livere:
uid:
ParameterExplanation
uidYour Livere UID. You can create it here.

The Livere UID can be found here:

hexo-theme-butterfly-doc-laibili.jpg

Follow the Gitalk instructions to obtain your GitHub OAuth application client ID and secret, and check the related configuration instructions.

1
2
3
4
5
6
7
gitalk:
client_id:
client_secret:
repo:
owner:
admin:
option:
ParameterExplanation
client_idGitHub application's client ID.
client_secretGitHub application's client secret.
repoThe repo to store issues.
ownerThe owner of the repo to store issues.
adminThe owner and collaborators of the GitHub repository (users with write permissions to the repository).
optionOptional configuration.

Follow the Valine instructions to configure your LeanCloud application and check the relevant configuration instructions.

1
2
3
4
5
6
7
8
9
10
valine:
appId:
appKey:
avatar: monsterid

serverURLs:
bg:

visitor: false
option:
ParameterExplanation
appIdThe appId of your LeanCloud application.
appKeyThe appKey of your LeanCloud application.
avatarAvatar type, optional values: '', mp, identicon, monsterid, wavatar, retro, robohash, blank, 404.
serverURLsCustom LeanCloud server address. If you use a custom domain in mainland China, please fill in this item, otherwise, leave it empty.
bgBackground image, can be an image URL like https://example.com/bg.jpg.
visitorWhether to display the article read count.
optionOptional configuration.

When visitor is enabled, the article read count on the article page will be provided by Valine, not Busuanzi.

Valine supports custom emojis from v1.4.5. If you need to configure them, set the emojiCDN to your custom emoji CDN.

Also, create a JSON file valine.json in the source/_data/ directory under your Hexo working directory, equivalent to Valine's emojiMaps configuration. The valine.json can be configured as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
"tv_doge": "6ea59c827c414b4a2955fe79e0f6fd3dcd515e24.png",
"tv_親親": "a8111ad55953ef5e3be3327ef94eb4a39d535d06.png",
"tv_偷笑": "bb690d4107620f1c15cff29509db529a73aee261.png",
"tv_再見": "180129b8ea851044ce71caf55cc8ce44bd4a4fc8.png",
"tv_冷漠": "b9cbc755c2b3ee43be07ca13de84e5b699a3f101.png",
"tv_發怒": "34ba3cd204d5b05fec70ce08fa9fa0dd612409ff.png",
"tv_發財": "34db290afd2963723c6eb3c4560667db7253a21a.png",
"tv_可愛": "9e55fd9b500ac4b96613539f1ce2f9499e314ed9.png",
"tv_吐血": "09dd16a7aa59b77baa1155d47484409624470c77.png",
"tv_呆": "fe1179ebaa191569b0d31cecafe7a2cd1c951c9d.png",
"tv_嘔吐": "9f996894a39e282ccf5e66856af49483f81870f3.png",
"tv_困": "241ee304e44c0af029adceb294399391e4737ef2.png",
"tv_壞笑": "1f0b87f731a671079842116e0991c91c2c88645a.png",
"tv_大佬": "093c1e2c490161aca397afc45573c877cdead616.png",
"tv_大哭": "23269aeb35f99daee28dda129676f6e9ea87934f.png",
"tv_委屈": "d04dba7b5465779e9755d2ab6f0a897b9b33bb77.png",
"tv_害羞": "a37683fb5642fa3ddfc7f4e5525fd13e42a2bdb1.png",
"tv_尷尬": "7cfa62dafc59798a3d3fb262d421eeeff166cfa4.png",
"tv_微笑": "70dc5c7b56f93eb61bddba11e28fb1d18fddcd4c.png",
"tv_思考": "90cf159733e558137ed20aa04d09964436f618a1.png",
"tv_驚嚇": "0d15c7e2ee58e935adc6a7193ee042388adc22af.png"
}

hexo-theme-butterfly-doc-valine.png

參數效果
empty(Default)
mp
identicon
monsterid
wavatar
retro
robohash
blank
404

Waline is a comment system derived from Valine that includes backend support. You can consider Waline as "With backend Valine".

Refer to the Waline documentation for detailed configuration.

1
2
3
4
5
waline:
serverURL:
bg:
pageview: false
option:
ParameterDescription
serverURLWaline server address
bgBackground image URL, e.g., https://example.com/bg.jpg
pageviewWhether to show article view count
optionOptional configuration

When pageview is enabled, the article view count will be provided by Waline instead of Busuanzi.

hexo-theme-butterfly-doc-valine.png

Like Gitalk, Utterances is a comment tool based on GitHub issues but with relatively fewer permissions required. Refer to Utterances documentation for details.

1
2
3
4
5
6
7
utterances:
repo:

issue_term: pathname

light_theme: github-light
dark_theme: photon-dark
ParameterDescription
repoGitHub repository full name, e.g., owner/repo
issue_termLabel used to identify issues, options: pathname/url/title/og:title
light_themeLight theme, options: github-light, github-dark, github-dark-orange, icy-dark, dark-blue, photon-dark
dark_themeDark theme, options: github-light, github-dark, github-dark-orange, icy-dark, dark-blue, photon-dark

hexo-theme-butterfly-docs-Utterances.png

Facebook Comments is a plugin provided by Facebook, requiring users to log in with Facebook to comment.

1
2
3
4
5
6
7
8
9
10


facebook_comments:
app_id:

user_id:
pageSize: 10

order_by: social
lang: zh_TW
ParameterDescription
app_idFacebook App ID, which can be created here
user_idOptional, Facebook User ID for managing comments
pageSizeNumber of comments to display
order_byComment sorting method: social/time/reverse_time
langLanguage

hexo-butterfly-docs-facebook-comments.png

Twikoo is a simple, secure, and serverless comment system for static websites, based on Tencent Cloud Development.

For detailed configuration, please refer to the Twikoo documentation.

你只需要把獲取到的 環境ID (envId) 填寫到配置上去就行

1
2
3
4
5
twikoo:
envId:
region:
visitor: false
option:
ParameterDescription
envIdEnvironment ID
regionEnvironment region, default is ap-shanghai. If your region is different, specify here.
visitorWhether to display article view count
optionOptional configuration

When visitor is enabled, the article view count will be provided by Twikoo instead of Busuanzi.

A comment system based on GitHub Discussions.

1
2
3
4
5
6
7
8
9
10


giscus:
repo:
repo_id:
category_id:
theme:
light: light
dark: dark
option:
ParameterDescription
repoGitHub repository full name, e.g., owner/repo
repo_idGitHub repository ID
category_idGitHub repository category ID
optionOptional configuration

Refer to the Giscus documentation for details.

hexo-theme-butterfly-docs-giscus.png

Remark42 is a comment system that only supports self-hosting.

For detailed setup, refer to Installation | Remark42.

1
2
3
4
remark42:
host:
siteId:
option:
ParameterDescription
hostYour Host URL
siteIdYour Site ID
optionOptional configuration

Artalk is a comment system that only supports self-hosting.

For detailed setup, refer to Artalk | Self-hosted Comment System.

1
2
3
4
5
6
artalk:
server:
site:

visitor: false
option:
ParameterDescription
serverYour Server URL
siteYour Site ID
visitorWhether to display article view count
optionOptional configuration

When visitor is enabled, the article view count will be provided by Artalk instead of Busuanzi.

Online Chat

The theme includes several online chat tools. You can choose to enable one to facilitate communication with your visitors.

1
2
3
4
5
6
7
8
9
chat:


use:


rightside_button: false

button_hide_show: false
ParameterDescription
useChoose the chat tool to use, options are chatra/tidio/crisp
rightside_buttonEnable the chat button at the bottom right corner
button_hide_showHide chat button when scrolling down, show when scrolling up

These tools provide a button to open/close the chat window. The theme also provides a custom button that will appear in the bottom right corner. Just enable the rightside_button.

To avoid affecting user experience, the theme offers a button_hide_show configuration. Set to true to show the chat button only when scrolling up.

To enable Chatra, set the chat configuration use to chatra.

Configure Chatra by getting the Public key.

  1. Open Chatra and sign up.
  2. Find the Public key in Preferences.

hexo-theme-butterfly-docs-chat-chatra-id.png

1
2
3
4


chatra:
id: xxxxxxxx

You can customize Chatra's style in Chat Widget.

hexo-theme-butterfly-docs-chat-chatra-ui-settings.png

To enable Tidio, set the chat configuration use to tidio.

Configure Tidio by getting the Public key.

  1. Open Tidio and sign up.
  2. Find the Public key in Preferences > Developer.

hexo-theme-butterfly-docs-chat-tidio-id.png

1
2
3
4


tidio:
public_key: XXXX

You can customize Tidio's style in Channels.

hexo-theme-butterfly-docs-chat-tidio-setting.png

To enable Crisp, set the chat configuration use to crisp.

Configure Crisp by getting the Website ID.

  1. Open Crisp and sign up.
  2. Find the Website ID.
1
2
3
4


crisp:
website_id: xxxxxxxx

hexo-theme-buttefly-docs-chat-crisp.png

hexo-theme-butterfly-docs-crisp-demo.png

Analytics

  1. Log in to the Baidu Analytics official website.

  2. Locate your Baidu Analytics code.

hexo-theme-butterfly-doc-baidu-tongji.jpg

  1. Modify the theme configuration file:
1
baidu_analytics: your_code
  1. Log in to the Google Analytics official website.

  2. Find your Google Analytics tracking ID.

hexo-theme-butterfly-doc-google-analytics.jpg

  1. Modify the theme configuration file:
1
google_analytics: your_code 
  1. Log in to the Cloudflare Analytics official website.
  2. Locate the JavaScript Snippet.
  3. Find your token.

hexo-theme-butterfly-docs-cloudflare-analytics-id.png

  1. Modify the theme configuration file:

    1
    2
    3


    cloudflare_analytics:
  1. Log in to the Clarity official website.

  2. Create a PROJECT.

  3. Find your ID.

hexo-theme-butterfly-docs-clarity-id.png

  1. Modify the theme configuration file:

    1
    2
    3


    microsoft_clarity:

Advertisements

The theme integrates Google Ads (Auto Ads).

1
2
3
4
5
6
google_adsense:
enable: true
auto_ads: true
js: https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js
client:
enable_page_level_ads: true

hexo-theme-butterfly-docs-google-adsense1.png

The theme reserves three spots for inserting ads: after every three articles on the homepage, after the aside announcement, and after the post donation section. Fill in the HTML code in the corresponding position.

1
2
3
4
ad:
index:
aside:
post:

例如:

1
index: <ins class="adsbygoogle" style="display:block" data-ad-format="fluid" data-ad-layout-key="xxxxxxxxxxxx" data-ad-client="ca-pub-xxxxxxxxxx" data-ad-slot="xxxxxxxxxx"></ins><script>(adsbygoogle=window.adsbygoogle||[]).push({})</script>

Website Verification

If you need search engines to index your site, you may need to log in to the corresponding search engine management platform for submission. Verification codes can be obtained from each management platform.

1
2
3
4
5
site_verification:




Beautify / Effect

Custom Theme Colors

You can modify most UI colors.

Edit the theme configuration file, for example:

Color values must be enclosed in double quotes, like "#000" instead of #000. Otherwise, an error will occur during the build process!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
theme_color:
enable: true
main: '#49B1F5'
paginator: '#00c4b6'
button_hover: '#FF7242'
text_selection: '#00c4b6'
link_color: '#99a9bf'
meta_color: '#858585'
hr_color: '#A4D8FA'
code_foreground: '#F47466'
code_background: 'rgba(27, 31, 35, .05)'
toc_color: '#00c4b6'
blockquote_padding_color: '#49b1f5'
blockquote_background_color: '#49b1f5'
scrollbar_color: '#49b1f5'
meta_theme_color_light: 'ffffff'
meta_theme_color_dark: '#0d0d0d'
ParameterDescription
mainMain theme color
paginatorPaginator color
button_hoverButton hover color
text_selectionText selection color
link_colorLink color
meta_colorArticle metadata color
hr_colorHorizontal rule color
code_foregroundCode foreground color
code_backgroundCode background color
toc_colorTable of contents color
blockquote_padding_colorBlockquote padding color
blockquote_background_colorBlockquote background color
scrollbar_colorScrollbar color
meta_theme_color_lightLight mode theme color
meta_theme_color_darkDark mode theme color

Justify Text Alignment

You can set text to be justified, except for the last line.

1
2

text_align_justify: true

text_align_justify: false

Black Mask

To avoid overly bright images making text unreadable, a black mask is added to header and footer by default.

1
2
3
4

mask:
header: true
footer: true

Page Load Animation (Preloader)

When entering a webpage, due to loading speed issues, the top_img image may appear fragmented, or the webpage may not load fully, resulting in a wait time. Enabling the preloader will show a loading animation, which will disappear once the page is fully loaded.

The theme supports the loading animation of pace.js, see pace.js for details.

1
2
3
4
5
6
7
8
9

preloader:
enable: false



source: 1

pace_css_url:

hexo-theme-butterfly-docs-preloader.gif

Page Beautification

It changes the styles of ol, ul, h1-h5.

field configuration applies to:

  • post Applies only to the post page
  • site Applies to the entire site
1
2
3
4
5
6

beautify:
enable: true
field: site
title-prefix-icon: '\f0c1'
title-prefix-icon-color: '#F47466'
ParameterDescription
enableEnable beautification
fieldArea to be beautified
title-prefix-iconPrefix icon for titles
title-prefix-icon-colorColor of the prefix icon

title-prefix-icon is the Unicode value of the fontawesome icon.
hexo-theme-butterfly-doc-fontwesome-unicode.png

hexo-theme-butterfly-doc-post-beautify.png

hexo-theme-butterfly-doc-post-beautif.png

Custom Fonts and Font Sizes

Global Fonts

You can set the font-family for the entire site.

If no configuration is needed, leave it empty.

1
2
3
4
5
6
7


font:
global-font-size:
code-font-size:
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Lato, Roboto, "PingFang SC", "Microsoft JhengHei", "Microsoft YaHei", sans-serif
code-font-family: consolas, Menlo, "PingFang SC", "Microsoft JhengHei", "Microsoft YaHei", sans-serif
ParameterDescription
global-font-sizeGlobal font size
code-font-sizeCode font size
font-familyGlobal font family
code-font-familyCode font family

Blog Title Font

You can set the font-family for the site title and subtitle.
If no configuration is needed, leave it empty.
If no web font is needed, leave font_link empty.

1
2
3
4
5


blog_title_font:
font_link: https://fonts.googleapis.com/css?family=Titillium+Web&display=swap
font-family: Titillium Web, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft JhengHei', 'Microsoft YaHei', sans-serif
ParameterDescription
font_linkLink to the web font
font-familyFont family for the site title

Typing Effect

Typing effect activate-power-mode.

1
2
3
4
5
6
7


activate_power_mode:
enable: true
colorful: true
shake: true
mobile: false
ParameterDescription
enableEnable typing effect
colorfulEnable particle animation
shakeEnable shake effect
mobileEnable typing effect on mobile

hexo-theme-butterfly-doc-type-animation.gif

Background Effects

Beautiful ribbon background, can be set to change ribbon on each refresh or on each click

1
2
3
4
5
6
7
8
9
canvas_ribbon:
enable: false

size: 150

alpha: 0.6
zIndex: -1
click_to_change: false
mobile: false
ParameterDescription
enableEnable ribbon effect
sizeSize of the ribbon
alphaOpacity of the ribbon
zIndexz-index of the ribbon
click_to_changeChange ribbon on click
mobileShow ribbon on mobile

For more configuration, refer to canvas_ribbon

Beautiful ribbon background that floats

1
2
3
canvas_fluttering_ribbon:
enable: true
mobile: false

1
2
3
4
5
6
7
8
9
10
11
canvas_nest:
enable: false

color: '0,0,255'

opacity: 0.7

zIndex: -1

count: 99
mobile: false
ParameterDescription
enableEnable nest effect
colorColor of the lines
opacityOpacity of the lines
zIndexz-index of the lines
countNumber of lines
mobileShow effect on mobile

Mouse Click Effects

1
2
3
4
fireworks:
enable: true
zIndex: 9999
mobile: false
ParameterDescription
enableEnable fireworks effect
zIndexz-index of fireworks (-1 means behind / 9999 means in front)
mobileShow fireworks on mobile

hexo-theme-butterfly-doc-firewall.gif

1
2
3
4

click_heart:
enable: true
mobile: false

click_heart.gif

1
2
3
4
5
6
7
8
9
10

ClickShowText:
enable: false
text:
- I
- LOVE
- YOU
fontSize: 15px
random: false
mobile: false
ParameterDescription
enableEnable text effect
textText content
fontSizeFont size
randomRandomize text display
mobileShow text on mobile

ClickShowText.gif

If you do not want to add lightbox for a specific image, use HTML format to reference the image and add no-lightbox class name to the image

1
2
3
4
5




lightbox:

You can configure fancybox or medium_zoom to enable lightbox.
Leave it empty if no lightbox is needed.

fancybox.gif

medium_zoom.gif

Tag Plugins

For details, see Tag Plugins

Mermaid

The theme supports Mermaid.js, which can be used to draw flowcharts, sequence diagrams, etc., in articles.

1
2
3
4
5
6
7
8
9
10


mermaid:
enable: true

code_write: true

theme:
light: default
dark: dark

Writing Methods

The theme supports two writing methods

Tag Plugin

You can use the tag plugin method to use Mermaid.js For details, see Tag Plugins

Code Block Writing

You can use the code block method to use Mermaid.js

  1. Hexo version needs to be 7.0 or above

  2. Add exclude_languages: ['mermaid'] to the Hexo configuration file

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    syntax_highlighter: 'highlight.js'
    highlight:
    line_number: true
    auto_detect: false
    tab_replace: ''
    wrap: true
    hljs: false
    exclude_languages: ['mermaid']
    prismjs:
    preprocess: true
    line_number: true
    tab_replace: ''
    exclude_languages: ['mermaid']
  3. Set code_write to true in the Mermaid configuration of the Butterfly theme

Demo

graph TD;
  A-->B;
  A-->C;
  B-->D;
  C-->D;

Pjax

When a user clicks a link, the parts of the page that need to be updated are done so via Ajax, and then the browser's URL is modified using HTML5's pushState.

This avoids reloading identical resources (css/js), thereby improving page load speed.

1
2
3
4
5
pjax:
enable: false

exclude:

For some third-party plugins, Pjax may not be supported.
You can add web pages to the exclude list to exempt them from Pjax.
Clicking these pages will reload the website.

After using Pjax, some custom JavaScript may become ineffective and need to be re-invoked when navigating pages. Refer to the Pjax documentation.
Also, some specific pages' js/css will be loaded on all pages after using Pjax.

Snackbar - Toast Notification

Enable the Snackbar based on personal preference.

1
2
3
4
5
6
7
8
9



snackbar:
enable: false
position: bottom-left

bg_light: '#49b1f5'
bg_dark: '#1f1f1f'

Instantpage

When the mouse hovers over a link for more than 65 milliseconds, Instantpage preloads the link, improving access speed.

1
2
3


instantpage: true

PWA

To add PWA features to Butterfly, you need to follow these steps:

  1. Open the hexo working directory.

  2. Run npm install hexo-offline --save or yarn add hexo-offline.

  3. Create a file named hexo-offline.config.cjs in the hexo directory and add the following content:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

module.exports = {
globPatterns: ['**/*.{js,html,css,png,jpg,gif,svg,webp,eot,ttf,woff,woff2}'],

globDirectory: 'public',
swDest: 'public/service-worker.js',
maximumFileSizeToCacheInBytes: 10485760,
skipWaiting: true,
clientsClaim: true,
runtimeCaching: [

{
urlPattern: /^https:\/\/cdn\.example\.com\/.*/,
handler: 'CacheFirst'
}
]
}

For more details, refer to the official hexo-offline documentation.

  1. Enable the PWA option in the theme configuration file.
1
2
3
4
5
6
7
pwa:
enable: true
manifest: /img/pwa/manifest.json
apple_touch_icon: /img/pwa/apple-touch-icon.png
favicon_32_32: /img/pwa/32.png
favicon_16_16: /img/pwa/16.png
mask_icon: /img/pwa/safari-pinned-tab.svg
  1. Create a manifest.json file in the source/ directory.
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
{
"name": "string",
"short_name": "Junzhou",
"theme_color": "#49b1f5",
"background_color": "#49b1f5",
"display": "standalone",
"scope": "/",
"start_url": "/",
"icons": [
{
"src": "images/pwaicons/36.png",
"sizes": "36x36",
"type": "image/png"
},
{
"src": "images/pwaicons/48.png",
"sizes": "48x48",
"type": "image/png"
},
{
"src": "images/pwaicons/72.png",
"sizes": "72x72",
"type": "image/png"
},
{
"src": "images/pwaicons/96.png",
"sizes": "96x96",
"type": "image/png"
},
{
"src": "images/pwaicons/144.png",
"sizes": "144x144",
"type": "image/png"
},
{
"src": "images/pwaicons/192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "images/pwaicons/512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"splash_pages": null
}

You can also quickly create a manifest.json using the Web App Manifest. (Web App Manifest requires at least one 512x512 pixel icon).

  1. Use the Chrome Lighthouse plugin to check if the PWA configuration is effective and correct.

    • Open the blog page.
    • Launch the Lighthouse plugin (Lighthouse plugin requires at least one 512x512 pixel icon).

For more information on PWA (Progressive Web Apps), refer to Google Tools for Web Developers.

Open Graph

Add some meta data such as thumbnails, titles, and dates in the head. When you share a webpage on certain platforms, the platform will read the Open Graph content and display information like thumbnails and titles.

1
2
3
4
5
6
7
8
9
10
11
12


Open_Graph_meta:
enable: true
option:







CSS Prefixes

Some CSS properties are not supported by all browsers and need corresponding prefixes to be effective.

Enabling css_prefix will automatically add prefixes to some CSS properties (increasing the size by 20%).

1
2

css_prefix: true

Inject

Supported from version 2.3.0 and above

If you want to add extra JavaScript, CSS, meta tags, etc., you can add them in inject. This supports adding to the head (before the </body> tag) and the bottom (before the </html> tag).

Note: Add the content in standard HTML format.

For example:

1
2
3
4
5
inject:
head:
- <link rel="stylesheet" href="/self.css">
bottom:
- <script src="xxxx"></script>

Note: If your site root directory is not '/', you need to include your root directory when using local images.
For example: If your site is https://yoursite.com/blog and you want to reference css/xx.css, set it as <link rel="stylesheet" href="/blog/css/xx.css">.

CDN

The last part of the configuration file is CDN, which includes files referenced by the theme. You can configure the CDN yourself (please do not modify unless necessary, and confirm that the links are accessible after configuration).

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


CDN:




internal_provider: local
third_party_provider: jsdelivr


version: false



custom_format:

option:






















































ParameterExplanation
internal_providerInternal files of the theme
Options: local/jsdelivr/unpkg/cdnjs/custom
local for local loading, custom for custom format, needs to configure custom_format
Note: If using the Dev version, it can only be set to local
third_party_providerThird-party files
Options: local/jsdelivr/unpkg/cdnjs/custom
local for local loading, custom for custom format, needs to configure custom_format
Note: If you choose local, you need to install the hexo-butterfly-extjs plugin
versiontrue/false to add the specified version number to the CDN
custom_formatCustom format
optionYou can replace some files here, which will override the original configuration

version

To modify the version number, you can change the version in the 'plugins.yml' file in the theme directory.

Please ensure that the version number you modify is included in the CDN you use.

custom_format

Provides the following parameters:

ParameterExplanation
namePackage name on npm
fileFile path on npm
min_fileMinified file path on npm
cdnjs_namePackage name on cdnjs
cdnjs_fileFile path on cdnjs
min_cdnjs_fileMinified file path on cdnjs
versionPlugin version number

Partial list of available third-party CDNs:

Please ensure that the CDN you choose includes the third-party plugins used by the theme.

ProviderFormatRemarks
Staticfile (Qiniu Cloud)https://cdn.staticfile.org/${cdnjs_name}/${version}/${min_cdnjs_file}Sync with cdnjs
BootCDNhttps://cdn.bootcdn.net/ajax/libs/${cdnjs_name}/${version}/${min_cdnjs_file}Sync with cdnjs
Baomitu (360)Latest version: https://lib.baomitu.com/${cdnjs_name}/latest/${min_cdnjs_file}
Specified version: https://lib.baomitu.com/${cdnjs_name}/${version}/${min_cdnjs_file}
Sync with cdnjs
ElemecdnLatest version: https://npm.elemecdn.com/${name}@latest/${file}
Specified version: https://npm.elemecdn.com/${name}@${version}/${file}
Sync with npm
⚔️ Butterfly document - Tag Plugins