修改aside_archives.js

打开[you_blog]\themes\butterfly\scripts\helpers\aside_archives.js修改第92行左右。

1
2
3
4
5
6
7
8
9
result += transform ? transform(item.name) : item.name
result += '</span>'

if (showCount) {
- result += `<span class="card-archive-list-count">${item.count}</span>`
+ result += `<div class="card-archive-list-count-group"><span class="card-archive-list-count">${item.count}</span><span>篇</span></div>`
}
result += '</a>'
result += '</li>'

增加css

在自定义css文件中添加如下代码:

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
/* 侧栏归档样式start */
span.card-archive-list-count {
width: auto;
text-align: left;
font-size: 1.5rem;
line-height: 0.9;
font-weight: 700;
}
.card-archive-list-count-group {
display: flex;
flex-direction: row;
align-items: baseline;
}
#aside-content .card-archives ul.card-archive-list > .card-archive-list-item a span:last-child,
#aside-content .card-categories ul.card-category-list > .card-category-list-item a span:last-child {
width: fit-content;
margin-left: 4px;
}
span.card-archive-list-count {
width: auto;
text-align: left;
font-size: 1.1rem;
line-height: 0.9;
font-weight: 700;
}
.card-archive-list-date {
font-size: 14px;
opacity: 0.6;
}
li.card-category-list-item {
flex: 0 0 31%;
}
li.card-archive-list-item {
flex: 0 0 48%;
}
#aside-content .card-archives ul.card-archive-list > .card-archive-list-item a:hover,
#aside-content .card-categories ul.card-category-list > .card-category-list-item a:hover {
color: #fff;
background-color: #3b70fc;
box-shadow: 0 8px 12px -3px #4259ef23;
border-radius: 8px;
padding-left: 0.5rem;
padding-right: 0.5rem;
}
@media screen and (min-width: 1300px) {
#aside-content .card-archives ul.card-archive-list > .card-archive-list-item a:hover,
#aside-content .card-categories ul.card-category-list > .card-category-list-item a:hover {
transform: scale(1.03);
}
#aside-content .card-archives ul.card-archive-list > .card-archive-list-item a:active,
#aside-content .card-categories ul.card-category-list > .card-category-list-item a:active {
transform: scale(0.97);
}
}
#aside-content .card-archives ul.card-archive-list > .card-archive-list-item a,
#aside-content .card-categories ul.card-category-list > .card-category-list-item a {
border-radius: 8px;
margin: 4px 0;
display: flex;
flex-direction: column;
align-content: space-between;
border: 1px solid #e3e8f7;
}
#aside-content .card-archives ul.card-archive-list > .card-archive-list-item a span:first-child,
#aside-content .card-categories ul.card-category-list > .card-category-list-item a span:first-child {
width: auto;
flex: inherit;
}
#aside-content .card-archives ul.card-archive-list,
#aside-content .card-categories ul.card-category-list {
display: flex;
flex-direction: row;
justify-content: space-between;
flex-wrap: wrap;
}
/* 侧栏归档样式end */
08-标签云增加文章数上下标 06-添加侧边栏电子钟