Skip to content

Commit 17a3e80

Browse files
committed
fix:search
1 parent 7b3f957 commit 17a3e80

4 files changed

Lines changed: 37 additions & 45 deletions

File tree

_config.butterfly.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,8 @@ math:
485485
search:
486486
# Choose: algolia_search / local_search / docsearch
487487
# leave it empty if you don't need search
488-
use:
489-
placeholder:
488+
use: local_search
489+
placeholder: 搜索...
490490

491491
# Algolia Search
492492
algolia_search:
@@ -825,8 +825,8 @@ beautify:
825825
# Global font settings
826826
# Don't modify the following settings unless you know how they work
827827
font:
828-
global-font-size: 16px
829-
code-font-size: 14px
828+
global_font_size:
829+
code_font_size:
830830
font_family:
831831
code_font_family:
832832

_config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,13 @@ markdown:
133133
- markdown-it-task-lists
134134

135135
# search
136+
search:
137+
path: search.json
138+
field: post
139+
content: true
140+
format: striptags
141+
142+
# algolia search
136143
algolia:
137144
appId: "FVIZJ7YP5J"
138145
apiKey: "ba1d0d348343249abfc39fb81845b772"

package-lock.json

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/css/butterfly/custom.css

Lines changed: 24 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,31 @@
1-
[data-theme='light'] {
2-
3-
/*
4-
背景颜色
5-
*/
6-
#recent-posts>.recent-post-item {
7-
background: #ffffffb3;
8-
}
9-
10-
/*
11-
侧边栏背景
12-
*/
13-
#aside-content .card-widget {
14-
background: #ffffffb3;
15-
}
16-
17-
18-
/*
19-
背景渐变
20-
*/
21-
#web_bg {
22-
background: radial-gradient(at 26.132516836382504% 86.99190910836059%, hsla(0, 0%, 100%, 1) 0%, hsla(0, 0%, 100%, 0) 100%), radial-gradient(at 57.738295994743126% 37.38034498579115%, hsla(226.22950819672133, 54.46428571428572%, 43.92156862745098%, 1) 0%, hsla(226.22950819672133, 54.46428571428572%, 43.92156862745098%, 0) 100%), radial-gradient(at 61.76127394286329% 0.2615760044830773%, hsla(72.98245614035088, 96.61016949152543%, 65.29411764705883%, 1) 0%, hsla(72.98245614035088, 96.61016949152543%, 65.29411764705883%, 0) 100%), radial-gradient(at 34.692174846954195% 51.74700152962741%, hsla(0, 0%, 100%, 1) 0%, hsla(0, 0%, 100%, 0) 100%), radial-gradient(at 11.158524154518135% 29.676311922552035%, hsla(226.22950819672133, 54.46428571428572%, 43.92156862745098%, 1) 0%, hsla(226.22950819672133, 54.46428571428572%, 43.92156862745098%, 0) 100%), radial-gradient(at 55.05598829218813% 19.87923178035561%, hsla(72.98245614035088, 96.61016949152543%, 65.29411764705883%, 1) 0%, hsla(72.98245614035088, 96.61016949152543%, 65.29411764705883%, 0) 100%), radial-gradient(at 12.07442067104183% 56.77885915723855%, hsla(0, 0%, 100%, 1) 0%, hsla(0, 0%, 100%, 0) 100%), radial-gradient(at 37.25134657586153% 97.51373978060788%, hsla(226.22950819672133, 54.46428571428572%, 43.92156862745098%, 1) 0%, hsla(226.22950819672133, 54.46428571428572%, 43.92156862745098%, 0) 100%);
23-
}
24-
}
25-
26-
/*
27-
top图大小
28-
*/
29-
#page-header.full_page {
30-
height: 80vh;
1+
/* 自定义header图片高度为一半屏幕 */
2+
#page-header {
3+
height: 50vh !important;
4+
min-height: 50vh !important;
315
}
326

33-
#page-header.post-bg {
34-
height: 300px;
7+
/* 确保header内容垂直居中 */
8+
#page-header #site-info {
9+
position: absolute;
10+
top: 50%;
11+
left: 50%;
12+
transform: translate(-50%, -50%);
13+
width: 100%;
14+
text-align: center;
3515
}
3616

37-
#page-header.not-home-page {
38-
height: 300px;
17+
/* 调整导航栏位置 */
18+
#page-header #nav {
19+
position: absolute;
20+
top: 0;
21+
width: 100%;
22+
z-index: 100;
3923
}
4024

41-
/*
42-
侧边按钮
43-
*/
44-
#rightside>div>button,
45-
#rightside>div>a {
46-
border-radius: 50%;
25+
/* 调整滚动下拉按钮位置 */
26+
#page-header #scroll-down {
27+
position: absolute;
28+
bottom: 20px;
29+
left: 50%;
30+
transform: translateX(-50%);
4731
}

0 commit comments

Comments
 (0)