Skip to content

Commit e88b55d

Browse files
committed
修改侧栏
1 parent cb31afd commit e88b55d

File tree

5 files changed

+17
-14
lines changed

5 files changed

+17
-14
lines changed

_config.butterfly.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -330,10 +330,17 @@ aside:
330330
您现在距离我大约<span id="distance">1919810</span>公里
331331
</div>
332332
card_recent_post:
333-
enable: true
333+
enable: false
334334
limit: 6 # if set 0 will show all
335335
sort: date # date or updated
336336
sort_order: # Don't modify the setting unless you know how it works
337+
card_archives:
338+
enable: true
339+
type: monthly # yearly or monthly
340+
format: MM 月 YYYY # eg: YYYY年MM月
341+
order: -1 # Sort of order. 1, asc for ascending; -1, desc for descending
342+
limit: 8 # if set 0 will show all
343+
sort_order: # Don't modify the setting unless you know how it works
337344
card_categories:
338345
enable: true
339346
limit: 5 # if set 0 will show all
@@ -346,13 +353,6 @@ aside:
346353
orderby: random # Order of tags, random/name/length
347354
order: 1 # Sort of order. 1, asc for ascending; -1, desc for descending
348355
sort_order: # Don't modify the setting unless you know how it works
349-
card_archives:
350-
enable: true
351-
type: monthly # yearly or monthly
352-
format: MM月YYYY # eg: YYYY年MM月
353-
order: -1 # Sort of order. 1, asc for ascending; -1, desc for descending
354-
limit: 8 # if set 0 will show all
355-
sort_order: # Don't modify the setting unless you know how it works
356356
card_webinfo:
357357
enable: true
358358
post_count: true
@@ -382,11 +382,12 @@ runtimeshow:
382382

383383
# Aside widget - Newest Comments
384384
newest_comments:
385-
enable: false
385+
enable: true
386386
sort_order: # Don't modify the setting unless you know how it works
387-
limit: 6
388-
storage: 10 # unit: mins, save data to localStorage
387+
limit: 5
388+
storage: 5 # unit: mins, save data to localStorage
389389
avatar: true
390+
includeReply: false
390391

391392
# Bottom right button (右下角按鈕)
392393
# --------------------------------------

themes/butterfly/languages/default.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ aside:
8181
image: image
8282
link: link
8383
code: code
84+
quote: quote
8485
card_toc: Contents
8586
card_post_series: Series
8687

themes/butterfly/languages/zh-CN.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ aside:
7575
site_pv_name: 本站总访问量
7676
more_button: 查看更多
7777
card_newest_comments:
78-
headline: 最新评论
78+
headline: 最新评论(仅 Twikoo)
7979
loading_text: 正在加载中...
8080
error: 无法获取评论,请确认相关配置是否正确
8181
zero: 没有评论

themes/butterfly/layout/includes/third-party/newest-comments/twikoo-comment.pug

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ script.
33
const changeContent = (content) => {
44
if (content === '') return content
55

6+
content = content.replace(/<blockquote.*?>(.*?)<\/blockquote>/isg, '[!{_p("aside.card_newest_comments.quote")}]') // replace quote
67
content = content.replace(/<img.*?src="(.*?)"?[^\>]+>/ig, '[!{_p("aside.card_newest_comments.image")}]') // replace image link
78
content = content.replace(/<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi, '[!{_p("aside.card_newest_comments.link")}]') // replace url
89
content = content.replace(/<pre><code>.*?<\/pre>/gi, '[!{_p("aside.card_newest_comments.code")}]') // replace code
@@ -20,7 +21,7 @@ script.
2021
envId: '!{theme.twikoo.envId}',
2122
region: '!{theme.twikoo.region}',
2223
pageSize: !{theme.newest_comments.limit},
23-
includeReply: true
24+
includeReply: !{theme.newest_comments.includeReply}
2425
}).then(function (res) {
2526
const twikooArray = res.map(e => {
2627
return {

themes/butterfly/layout/includes/widget/index.pug

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
!=partial('includes/widget/card_recent_post', {}, {cache: true})
3030
!=partial('includes/widget/card_ad', {}, {cache: true})
3131
!=partial('includes/widget/card_newest_comment', {}, {cache: true})
32+
!=partial('includes/widget/card_archives', {}, {cache: true})
3233
!=partial('includes/widget/card_categories', {}, {cache: true})
3334
!=partial('includes/widget/card_tags', {}, {cache: true})
34-
!=partial('includes/widget/card_archives', {}, {cache: true})
3535
!=partial('includes/widget/card_webinfo', {}, {cache: true})
3636
!=partial('includes/widget/card_bottom_self', {}, {cache: true})

0 commit comments

Comments
 (0)