Skip to content

Commit f293c36

Browse files
committed
💄 更新主题至 4.3.0-b4
降级speak至4.2.0 分类和归档切换回时间轴布局
1 parent e1e7f9c commit f293c36

File tree

16 files changed

+192
-135
lines changed

16 files changed

+192
-135
lines changed

_config.butterfly.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ index_top_img_height:
603603
# The user interface setting of category and tag page (category和tag頁的UI設置)
604604
# index - same as Homepage UI (index 值代表 UI將與首頁的UI一樣)
605605
# default - same as archives UI 默認跟archives頁面UI一樣
606-
category_ui: index # 留空或 index
606+
category_ui: # 留空或 index
607607
tag_ui: index # 留空或 index
608608

609609
# Website Background (設置網站背景)
@@ -746,7 +746,10 @@ aside:
746746
button: true
747747
mobile: true # display on mobile
748748
position: right # left or right
749-
archives: false
749+
display:
750+
archive: false
751+
tag: false
752+
category: false
750753
card_author:
751754
enable: true
752755
description: ''
@@ -854,8 +857,8 @@ darkmode:
854857
# Don't repeat 不要重複
855858
rightside_item_order:
856859
enable: true
857-
hide: hideAside,chat
858-
show: toc,translate,readmode,darkmode,comment
860+
hide: hideAside,readmode,translate,darkmode,chat
861+
show: toc,comment
859862

860863
# Lightbox (圖片大圖查看模式)
861864
# --------------------------------------

source/blogroll/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ xkFriend.init({
2020
'https://blogroll.ccknbc.vercel.app/blogroll.json'
2121
], // 你的json链接列表,可以是多个。
2222
loading_img: 'https://cdn.jsdelivr.net/gh/ccknbc-backup/photos/blog/2021-03-08~15-13-15.gif', // 加载中的图片
23-
fail_img: 'https://cdn.jsdelivr.net/gh/ccknbc-backup/photos/blog/2021-03-08~15-13-15.gif' // // 加载失败的图片
23+
fail_img: 'https://cdn.jsdelivr.net/gh/ccknbc-backup/photos/blog/2021-03-08~15-13-15.gif' // 加载失败的图片
2424
})
2525
</script>
2626

source/essay/index.md

+4-101
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,6 @@ translate_title: essay
88
aside: false
99
description: CC的部落格 即刻短文页面
1010
---
11-
12-
<!-- <div id="daodao"></div>
13-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/ccknbc-backup/cdn@latest/css/daodao.min.css">
14-
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/ccknbc-backup/cdn@latest/js/daodao.min.js" ></script> -->
15-
16-
<!-- <div id="bber"></div>
17-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/ccknbc-backup/cdn@latest/css/newbber.min.css">
18-
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/ccknbc-backup/cdn@latest/js/newbber.min.js" ></script> -->
19-
20-
<!-- <div id='speak'></speak> -->
21-
<!-- 使用markdown渲染 -->
22-
<!-- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ispeak-bber/ispeak-bber-md.min.js" charset="utf-8" ></script> -->
23-
<!-- 不使用markdown渲染 -->
24-
<!-- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ispeak-bber/ispeak-bber.min.js" charset="utf-8" ></script> -->
25-
<!-- 解析微信表情(参考:https://github.com/buddys/qq-wechat-emotion-parser) -->
26-
<!-- <script src="https://cdn.jsdelivr.net/gh/buddys/qq-wechat-emotion-parser@master/dist/qq-wechat-emotion-parser.min.js"></script>
27-
<script>
28-
ispeakBber
29-
.init({
30-
el: '#speak', // 容器选择器
31-
name: 'CC 😊', // 显示的昵称
32-
envId: 'ccknbc-154167', // 环境id
33-
region: 'ap-shanghai', // 腾讯云地址,默认为上海
34-
limit: 10, // 每次加载的条数,默认为5
35-
avatar: 'https://cdn.jsdelivr.net/gh/ccknbc-backup/cdn@latest/logo/logo.png',
36-
fromColor:'rgb(245, 150, 170)', // 下方标签背景颜色 默认 rgb(245, 150, 170)
37-
loadingImg: 'https://cdn.jsdelivr.net/gh/ccknbc-backup/photos/blog/2021-03-08~15-13-15.gif', // 自定义loading的图片,示例值为默认值
38-
dbName:'talks' // 数据的名称,默认talks,避免有人的命名不是这个,所以加入此配置字段。
39-
})
40-
.then(function() {
41-
// 哔哔加载完成后的回调函数,你可以写你自己的功能
42-
console.log('哔哔 加载完成')
43-
})
44-
</script> -->
45-
4611
<div id="tip" style="text-align:center;">ipseak加载中</div>
4712
<div id="ispeak"></div>
4813
<link
@@ -51,7 +16,7 @@ ispeakBber
5116
/>
5217
<link
5318
rel="stylesheet"
54-
href="https://cdn.jsdelivr.net/npm/ispeak/style.css"
19+
href="https://cdn.jsdelivr.net/npm/ispeak@4.2.0/style.css"
5520
/>
5621

5722
<style>
@@ -65,7 +30,7 @@ ispeakBber
6530
<script src="https://cdn.staticfile.org/highlight.js/10.6.0/highlight.min.js"></script>
6631
<script src="https://cdn.staticfile.org/marked/2.0.0/marked.min.js"></script>
6732
<script src="https://cdn.jsdelivr.net/npm/discuss/dist/Discuss.js"></script>
68-
<script src="https://cdn.jsdelivr.net/npm/ispeak/ispeak.umd.js"></script>
33+
<script src="https://cdn.jsdelivr.net/npm/ispeak@4.2.0/ispeak.umd.js"></script>
6934
<script>
7035
var head = document.getElementsByTagName('head')[0]
7136
var meta = document.createElement('meta')
@@ -80,6 +45,8 @@ ispeakBber
8045
author: '621cd42048c49d6f96787626',
8146
pageSize: 10,
8247
loading_img: 'https://cdn.jsdelivr.net/gh/ccknbc-backup/photos/blog/2021-03-08~15-13-15.gif',
48+
speakPage: '/essay', // 例如 ‘/speak’
49+
githubClientId: 'Iv1.f333c02f5f6676e8', // 通过创建GitHub app获取
8350
initCommentName: 'Discuss',
8451
initCommentOptions: {
8552
serverURLs: 'https://discuss.ccknbc.vercel.app/'
@@ -93,67 +60,3 @@ ispeakBber
9360
document.getElementById('tip').innerHTML = 'ipseak依赖加载失败!'
9461
}
9562
</script>
96-
97-
98-
<!-- ## 哔哔 CloudBase 版本(林木木) -->
99-
100-
<!-- <div id="bber"></div>
101-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/ccknbc-backup/cdn@latest/css/bber.min.css">
102-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js" ></script>
103-
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js" ></script>
104-
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/TencentCloudBase/tcb-js-sdk@master/tcbjs/1.10.10/tcb.min.js" >
105-
</script><script src="https://cdn.jsdelivr.net/gh/buddys/qq-wechat-emotion-parser@master/dist/qq-wechat-emotion-parser.min.js"
106-
></script>
107-
<script>
108-
const app = tcb.init({
109-
env: 'ccknbc-154167'
110-
})
111-
</script>
112-
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/ccknbc-backup/cdn@latest/js/bber.min.js" ></script> -->
113-
114-
<!-- ## 哔哔 CloudBase 版本(Heo) -->
115-
116-
<!-- <div id="bber"></div>
117-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/ccknbc-backup/cdn@latest/css/newbber.min.css">
118-
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/ccknbc-backup/cdn@latest/js/newbber.min.js" ></script> -->
119-
120-
<!-- ## 说说(Artitalk) -->
121-
122-
<!-- <div id="artitalk_main"></div>
123-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/artitalk"></script>
124-
<script>
125-
new Artitalk({
126-
appId: 'pvExDcJ4o0gsrOI1G1eGO01H-MdYXbMMI',
127-
appKey: 'D4V4sTiVUkTmOqyVyBN79iDB',
128-
atComment: false
129-
})
130-
</script> -->
131-
132-
<!-- ## hpptalk(CYFan) -->
133-
134-
<!-- <div id="hpp_talk"></div>
135-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/HexoPlusPlus/HexoPlusPlus/talk.css" />
136-
<script src="https://cdn.jsdelivr.net/gh/HexoPlusPlus/HexoPlusPlus/talk_user.js"></script>
137-
<script>
138-
new hpp_talk({
139-
id:"hpp_talk",
140-
domain: "blog.ccknbc.workers.dev",
141-
limit: 10,
142-
start: 0,
143-
themecss: "https://cdn.jsdelivr.net/gh/HexoPlusPlus/cdn/plugin/theme/hpp_user_talk/bfonion.css"
144-
});
145-
</script> -->
146-
147-
<!-- ## 哔哔 LeanCloud 版本(黑石) -->
148-
149-
<!-- <div id="bbtalk"></div>
150-
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/bbtalk.min.js"></script>
151-
<script>
152-
bbtalk.init({
153-
appId: "MH2fWakWlJvGxqbMLX6itMJL-MdYXbMMI",
154-
appKey: "V5akWNoPYoo3595zOEw2XX5e",
155-
serverURLs: 'https://mh2fwakw.api.lncldglobal.com'
156-
})
157-
</script> -->
158-
159-
<!-- ## 求新版本啊啊啊 -->

source/offline/index.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: offline
2+
title: CC的部落格 离线页面
33
top_img: false
44
comments: false
55
aside: false
@@ -10,10 +10,10 @@ subtitle: Ur Offline
1010
description: CC的部落格 离线页面
1111
---
1212

13-
CC的部落格暂时无法访问,因此跳转到离线页面
13+
很抱歉,您暂时无法访问CC的部落格,因此跳转到离线页面
1414

1515
这有可能是CC的主站服务器全部炸裂,当然,更有可能的是您网络丢失,或者至少您与CC的服务器之间失去了联系。
1616

17-
可前往[**CC的状态页面**](https://cc.instatus.com/) 查看详情,考虑到请求及带宽原因,并未配置自动切换拉去镜像站内容我们无法从任何一个镜像站获取到最新的博客内容,但您可手动暂时访问下列镜像站点
17+
可前往[**CC的状态页面**](https://cc.instatus.com/) 查看故障详情或反馈,也可手动暂时访问下列镜像站点,感谢您的支持与理解!
1818

1919
{% note success flat %} 以下排名不分先后,请选择适合自己访问较快的即可</br> **[GitHub](https://ccknbc.github.io) | [GitLab](https://ccknbc.gitlab.io) | [Gitee](https://ccknbc.gitee.io) | [Bitbucket](https://ccknbc.bitbucket.io) | [Vercel](https://ccknbc.vercel.app) | [Netlify](https://ccknbc.netlify.app) | [CloudFlare](https://ccknbc.pages.dev)** {% endnote %}

sw.js

+69-9
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,42 @@ if (workbox) {
66
console.log('workbox加载失败😬');
77
}
88

9-
// Force development builds
9+
// Force production builds 是否关闭控制台中的输出
1010
workbox.setConfig({
1111
debug: true,
1212
});
1313

14-
// Force production builds 关闭控制台中的输出
15-
// workbox.setConfig({ debug: false });
16-
1714
// self.__WB_DISABLE_DEV_LOGS = true;
1815

1916
//设置缓存cachestorage的名称
2017
workbox.core.setCacheNameDetails({
2118
prefix: 'CC的部落格',
22-
// suffix: 'v1',
23-
precache: '预缓存',
24-
runtime: '运行时间',
25-
googleAnalytics: '谷歌分析'
19+
suffix: '缓存',
20+
precache: '离线后备',
21+
runtime: '运行时',
22+
// googleAnalytics: '谷歌分析'
2623
});
2724

2825
//直接激活跳过等待阶段
2926
self.skipWaiting();
3027
workbox.core.clientsClaim();
28+
// self.clients.claim();
3129

3230
// 预缓存
3331
workbox.precaching.precacheAndRoute(self.__WB_MANIFEST, {
3432
directoryIndex: null
3533
});
3634

35+
workbox.precaching.cleanupOutdatedCaches();
36+
37+
// 离线后备方式 1 需同步配置并开启预缓存且导航预加载并非所有浏览器支持 https://caniuse.com/mdn-api_navigationpreloadmanager_enable
3738
// Enable navigation preload.
3839
workbox.navigationPreload.enable();
3940

4041
// The network-only callback should match navigation requests, and
4142
// the handler for the route should use the network-only strategy, but
4243
// fall back to a precached offline page in case the user is offline.
44+
4345
const Offline = new workbox.routing.Route(({ request }) => {
4446
return request.mode === 'navigate';
4547
}, new workbox.strategies.NetworkOnly({
@@ -52,7 +54,65 @@ const Offline = new workbox.routing.Route(({ request }) => {
5254

5355
workbox.routing.registerRoute(Offline);
5456

55-
workbox.precaching.cleanupOutdatedCaches();
57+
// 离线后备方式 2 响应超时5秒后,跳转到离线页面
58+
59+
// Hardcode the fallback cache name and the offline
60+
// HTML fallback's URL for failed responses
61+
62+
// const FALLBACK_CACHE_NAME = '离线后备';
63+
// const FALLBACK_HTML = '/offline/index.html';
64+
65+
// // Cache the fallback HTML during installation.
66+
67+
// self.addEventListener('install', (event) => {
68+
// event.waitUntil(
69+
// caches.open(FALLBACK_CACHE_NAME).then((cache) => cache.add(FALLBACK_HTML)),
70+
// );
71+
// });
72+
73+
// Apply a network-only strategy to navigation requests.
74+
// If offline, or if more than five seconds pass before there's a
75+
// network response, fall back to the cached offline HTML.
76+
77+
// const Timeout = new workbox.strategies.NetworkOnly({
78+
// // networkTimeoutSeconds: 5,
79+
// plugins: [
80+
// {
81+
// handlerDidError: async () => {
82+
// return await caches.match(FALLBACK_HTML, {
83+
// cacheName: FALLBACK_CACHE_NAME,
84+
// });
85+
// },
86+
// },
87+
// ],
88+
// });
89+
90+
// Register the route to handle all navigations.
91+
92+
// workbox.routing.registerRoute(new workbox.routing.NavigationRoute(Timeout));
93+
94+
// 离线后备方案 3 综合后备请参考https://developer.chrome.com/docs/workbox/managing-fallback-responses/
95+
// 如果您需要做的只是提供一个自定义的离线 HTML 页面,但别无其他,这里有一个您可以遵循的基准配置:
96+
// 其他缓存选项默认配置可参考 https://developer.chrome.com/docs/workbox/modules/workbox-recipes 可极大节省配置时间
97+
// 只需准备一个名为 offline.html 的离线 HTML 页面,并将其放置在网站根目录下。
98+
99+
// workbox.routing.setDefaultHandler(new workbox.strategies.NetworkOnly());
100+
// workbox.recipes.offlineFallback();
101+
102+
// 一些缓存小策略
103+
// workbox.recipes.pageCache();
104+
// workbox.recipes.googleFontsCache();
105+
// workbox.recipes.staticResourceCache();
106+
// workbox.recipes.imageCache();
107+
// workbox.recipes.offlineFallback();
108+
109+
// 暖策略缓存
110+
// This can be any strategy, CacheFirst used as an example.
111+
112+
// const strategy = new workbox.strategies.StaleWhileRevalidate();
113+
// const urls = ['/offline/index.html'];
114+
// workbox.recipes.warmStrategyCache({urls, strategy});
115+
56116

57117
// Images
58118
// workbox.routing.registerRoute(

themes/butterfly/_config.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,10 @@ aside:
628628
button: true
629629
mobile: true # display on mobile
630630
position: right # left or right
631-
archives: true
631+
display:
632+
archive: true
633+
tag: true
634+
category: true
632635
card_author:
633636
enable: true
634637
description:

themes/butterfly/layout/archive.pug

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ extends includes/layout.pug
33
block content
44
include ./includes/mixins/article-sort.pug
55
#archive
6-
.article-sort-title= _p('page.articles') + ' - ' + site.posts.length
6+
- const archiveLength = findArchiveLength(fragment_cache)
7+
.article-sort-title= _p('page.articles') + ' - ' + archiveLength
78
+articleSort(page.posts)
89
include includes/pagination.pug

0 commit comments

Comments
 (0)