Skip to content

Commit

Permalink
🐛 再次修复 Discuss 评论系统@Lete114,暂时关闭PWA,测试一段时间SW
Browse files Browse the repository at this point in the history
  • Loading branch information
CCKNBC committed Jun 12, 2022
1 parent a8025a8 commit 87a527c
Show file tree
Hide file tree
Showing 27 changed files with 1,599 additions and 1,239 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/Deploy Hexo Public To Pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,19 @@ jobs:
gitee-password: ${{ secrets.GITEE_PASSWORD }}
gitee-repo: ccknbc/ccknbc

- name: Sync RSS
run: |
curl 'https://kkapi.ccknbc.vercel.app/api/open/github/dispatch&owner=ccknbc-actions&repo=home&token=${{ secrets.GH_TOKEN }}&runit_text=RSS'
curl -X POST -F token=${{ secrets.GITLAB_TRIGGER_TOKEN }} -F ref=master https://gitlab.com/api/v4/projects/22130436/trigger/pipeline
# - name: Sync RSS
# run: |
# curl 'https://kkapi.ccknbc.vercel.app/api/open/github/dispatch&owner=ccknbc-actions&repo=home&token=${{ secrets.GH_TOKEN }}&runit_text=RSS'
# curl -X POST -F token=${{ secrets.GITLAB_TRIGGER_TOKEN }} -F ref=master https://gitlab.com/api/v4/projects/22130436/trigger/pipeline

- name: Delete Workflow Runs
uses: Mattraks/delete-workflow-runs@main
with:
retain_days: 1
keep_minimum_runs: 1

- name: Telegram Notification
if: cancelled() == false
uses: xinthink/[email protected]
with:
botToken: ${{ secrets.TG_BOT_TOKEN }}
chatId: ${{ secrets.TG_CHAT_ID }}
jobStatus: ${{ job.status }}
skipSuccess: false
- name: Send message to Telegram
uses: Lukasss93/telegram-action@v2
env:
TELEGRAM_TOKEN: ${{ secrets.TG_BOT_TOKEN }}
TELEGRAM_CHAT: ${{ secrets.TG_CHAT_ID }}
21 changes: 9 additions & 12 deletions .github/workflows/Deploy Yuque-Hexo Public To Pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,19 @@ jobs:
gitee-password: ${{ secrets.GITEE_PASSWORD }}
gitee-repo: ccknbc/ccknbc

- name: Sync RSS
run: |
curl 'https://kkapi.ccknbc.vercel.app/api/open/github/dispatch&owner=ccknbc-actions&repo=home&token=${{ secrets.GH_TOKEN }}&text=RSS'
curl -X POST -F token=${{ secrets.GITLAB_TRIGGER_TOKEN }} -F ref=master https://gitlab.com/api/v4/projects/22130436/trigger/pipeline
# - name: Sync RSS
# run: |
# curl 'https://kkapi.ccknbc.vercel.app/api/open/github/dispatch&owner=ccknbc-actions&repo=home&token=${{ secrets.GH_TOKEN }}&text=RSS'
# curl -X POST -F token=${{ secrets.GITLAB_TRIGGER_TOKEN }} -F ref=master https://gitlab.com/api/v4/projects/22130436/trigger/pipeline

- name: Delete Workflow Runs
uses: Mattraks/delete-workflow-runs@main
with:
retain_days: 1
keep_minimum_runs: 1

- name: Telegram Notification
if: cancelled() == false
uses: xinthink/[email protected]
with:
botToken: ${{ secrets.TG_BOT_TOKEN }}
chatId: ${{ secrets.TG_CHAT_ID }}
jobStatus: ${{ job.status }}
skipSuccess: false
- name: Send message to Telegram
uses: Lukasss93/telegram-action@v2
env:
TELEGRAM_TOKEN: ${{ secrets.TG_BOT_TOKEN }}
TELEGRAM_CHAT: ${{ secrets.TG_CHAT_ID }}
47 changes: 27 additions & 20 deletions _config.butterfly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ error_img:
# A simple 404 page
error_404:
enable: true
subtitle: 页面离线了哦😬
subtitle: Oops! 页面离线了哦~
background: https://gejiba.com/view.php/3c3845c98419b590d7f6b6c8ec6add1c.gif

post_meta:
Expand Down Expand Up @@ -319,24 +319,25 @@ waline:
requiredMeta: ['nick', 'mail']
login: enable
copyright: true
uploadImage: false
imageUploader: false
locale:
admin: 博主兼管理员
sofa: 这里冷冷清清的,快来留下脚印吧!
placeholder: 感谢各位的批评指正,期待与您交流!
emoji: [
'https://gcore.jsdelivr.net/gh/zhheo/Sticker-Heo@main/Sticker-100/',
'https://gcore.jsdelivr.net/gh/walinejs/emojis@main/tw-emoji/'
'https://gcore.jsdelivr.net/npm/sticker-heo@latest/Sticker-100/',
'https://gcore.jsdelivr.net/npm/@waline/emojis@latest/tw-emoji/'
]

discuss:
serverURLs: https://discuss.ccknbc.vercel.app # Discuss server address url
option:
master: 博主兼管理员 # 博主标签占位符,默认: 博主
ph: 感谢各位的批评指正,期待与您交流! # 评论框占位符,默认: 评论你的想法~
lang: zh_CN # 评论语言,默认: zh_CN ,可选: [zh_CN , en_US]
imgLoading: # 评论图片懒加载,加载动画,默认为1像素白色base64图
options:
master: '博主兼管理员' # 博主标签占位符,默认: 博主
ph: '感谢各位的批评指正,期待与您交流!' # 评论框占位符,默认: 评论你的想法~
lang: 'zh_CN' # 评论语言,默认: zh_CN ,可选: [zh_CN , en_US]
# imgLoading: # 评论图片懒加载,加载动画,默认为1像素白色base64图
visitStat: false # 是否开启访问统计,默认: false
color: '#8fbc8f'

# Twikoo
# https://github.com/imaegoo/twikoo
Expand Down Expand Up @@ -995,7 +996,7 @@ snow:
# See https://github.com/JLHwung/hexo-offline
# ---------------
pwa:
enable: true
enable: false
manifest: /manifest.json
theme_color: "#ffffff"
apple_touch_icon: https://gcore.jsdelivr.net/gh/ccknbc-backup/cdn@latest/image/pwa/apple-touch-icon.png
Expand All @@ -1013,14 +1014,14 @@ css_prefix: true
# 插入代码到头部 </head> 之前 和 底部 </body> 之前
inject:
head:
- <style type="text/css">.app-refresh{position:fixed;top:-2.2rem;left:0;right:0;z-index:99999;padding:0 1rem;font-size:15px;height:2.2rem;transition:all .3s ease}.app-refresh-wrap{display:flex;color:#fff;height:100%;align-items:center;justify-content:center}.app-refresh-wrap a{color:#fff;text-decoration:underline;cursor:pointer}</style>
# - <style type="text/css">.app-refresh{position:fixed;top:-2.2rem;left:0;right:0;z-index:99999;padding:0 1rem;font-size:15px;height:2.2rem;transition:all .3s ease}.app-refresh-wrap{display:flex;color:#fff;height:100%;align-items:center;justify-content:center}.app-refresh-wrap a{color:#fff;text-decoration:underline;cursor:pointer}</style>
bottom:
# - <div class="aplayer no-destroy" data-id="12838890" data-server="netease" data-type="artist" data-fixed="true" data-mini="true" data-listFolded="false" data-order="random" data-preload="none" data-autoplay="true" muted></div>
- '<div class="app-refresh" id="app-refresh"> <div class="app-refresh-wrap"> <label>✨ 网站已更新 👉</label> <a href="javascript:void(0)" onclick="location.reload()">✔ <b>点击刷新</b> 💫</a> </div></div><script>function showNotification(){if(GLOBAL_CONFIG.Snackbar){let t="light"===document.documentElement.getAttribute("data-theme")?GLOBAL_CONFIG.Snackbar.bgLight:GLOBAL_CONFIG.Snackbar.bgDark,e=GLOBAL_CONFIG.Snackbar.position;Snackbar.show({text:"✨ 部落格已更新 👉",backgroundColor:t,duration:1e4,pos:e,actionText:"✔ 点击刷新 💫",textColor:"#8FBC8F",actionTextColor:"#4CAF50",onActionClick:function(t){location.reload()}})}else{let o=`top: 0; background: ${"light"===document.documentElement.getAttribute("data-theme")?"#49b1f5":"#1f1f1f"};`;document.getElementById("app-refresh").style.cssText=o}}"serviceWorker"in navigator&&(navigator.serviceWorker.controller&&navigator.serviceWorker.addEventListener("controllerchange",function(){showNotification()}),window.addEventListener("load",function(){navigator.serviceWorker.register("/sw.js")}));</script>'
# - '<div class="app-refresh" id="app-refresh"> <div class="app-refresh-wrap"> <label>✨ 网站已更新 👉</label> <a href="javascript:void(0)" onclick="location.reload()">✔ <b>点击刷新</b> 💫</a> </div></div><script>function showNotification(){if(GLOBAL_CONFIG.Snackbar){let t="light"===document.documentElement.getAttribute("data-theme")?GLOBAL_CONFIG.Snackbar.bgLight:GLOBAL_CONFIG.Snackbar.bgDark,e=GLOBAL_CONFIG.Snackbar.position;Snackbar.show({text:"✨ 部落格已更新 👉",backgroundColor:t,duration:1e4,pos:e,actionText:"✔ 点击刷新 💫",textColor:"#8FBC8F",actionTextColor:"#4CAF50",onActionClick:function(t){location.reload()}})}else{let o=`top: 0; background: ${"light"===document.documentElement.getAttribute("data-theme")?"#49b1f5":"#1f1f1f"};`;document.getElementById("app-refresh").style.cssText=o}}"serviceWorker"in navigator&&(navigator.serviceWorker.controller&&navigator.serviceWorker.addEventListener("controllerchange",function(){showNotification()}),window.addEventListener("load",function(){navigator.serviceWorker.register("/sw.js")}));</script>'
# - <script defer src="https://gcore.jsdelivr.net/gh/ccknbc-backup/cdn@latest/js/announcement.js"></script>
- <script defer src="https://cc.instatus.com/widget/script.js"></script>
- <script>!function(p){"use strict";!function(t){var s=window,e=document,i=p,c="".concat("https:"===e.location.protocol?"https://":"http://","sdk.51.la/js-sdk-pro.min.js"),n=e.createElement("script"),r=e.getElementsByTagName("script")[0];n.type="text/javascript",n.setAttribute("charset","UTF-8"),n.async=!0,n.src=c,n.id="LA_COLLECT",i.d=n;var o=function(){s.LA.ids.push(i)};s.LA?s.LA.ids&&o():(s.LA=p,s.LA.ids=[],o()),r.parentNode.insertBefore(n,r)}()}({id:"JgUfbwUA5BsLeAIc",ck:"JgUfbwUA5BsLeAIc",autoTrack:true});</script>
- <script>!(function(c,i,e,b){var h=i.createElement("script");var f=i.getElementsByTagName("script")[0];h.type="text/javascript";h.crossorigin=true;h.onload=function(){new c[b]["Monitor"]().init({id:"JgUg7s8ImDkwb2V7",sendSuspicious:true});};f.parentNode.insertBefore(h,f);h.src=e;})(window,document,"https://sdk.51.la/perf/js-sdk-perf.min.js","LingQue");</script>
- <script defer src="https://cc.instatus.com/widget/script.js"></script>
# - <script defer src='https://api.vvhan.com/api/snow'></script>
# - <script defer src="https://api.vvhan.com/api/denglong"></script>
# - <script src="https://cdn.staticfile.org/jquery/3.5.1/jquery.min.js"></script>
Expand All @@ -1031,21 +1032,27 @@ inject:
# 非必要請不要修改
CDN:
# The CDN provider of internal scripts (主題內部 js 的 cdn 配置)
# option: local/jsdelivr/unpkg
# Dev version cannot choose jsdelivr/unpkg (dev版的主題不能設置為 jsdelivr/unpkg)
# option: local/jsdelivr/unpkg/cdnjs/custom
# Dev version can only choose. ( dev版的主題只能設置為 local )
internal_provider: local
# The CDN provider of third party scripts (第三方 js 的 cdn 配置)
# option: local/jsdelivr/unpkg
# option: local/jsdelivr/unpkg/cdnjs/custom
# when set it to local, you need to install hexo-butterfly-extjs
third_party_provider: jsdelivr
third_party_provider: custom
# Custom format
# For example: https://cdn.staticfile.org/${cdnjs_name}/${version}/${min_cdnjs_file}
# https://gcore.jsdelivr.net/npm/${name}${verType}/${min_file}
custom_format: https://gcore.jsdelivr.net/npm/${name}@latest/${min_file}
# Add version number to CDN, true or false
version: false
option:
# main_css:
# main:
# utils:
# translate:
# local_search:
# algolia_js:

# algolia_search_v4:
# instantsearch_v4:
# pjax:
Expand Down Expand Up @@ -1090,9 +1097,9 @@ CDN:
# prismjs_js:
# prismjs_lineNumber_js:
# prismjs_autoloader:

# other
statuspage: https://ccknbc.statuspage.io/embed/script.js
pace: https://gcore.jsdelivr.net/gh/CodeByZach/pace/pace.min.js
ccknbc: https://gcore.jsdelivr.net/gh/ccknbc-backup/cdn@latest@master/js/ccknbc.js
ccknbc: https://gcore.jsdelivr.net/gh/ccknbc-backup/cdn@latest/js/ccknbc.js
discuss: https://gcore.jsdelivr.net/npm/discuss/dist/Discuss.js
13 changes: 11 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ algolia:
chunkSize: 5000
indexName: "ccknbc-blog"
fields:
- path
- title
- content:strip
- path

nofollow:
enable: true
Expand Down Expand Up @@ -308,4 +308,13 @@ wowjs:
offset: 100 #选填项,开始动画的距离(相对浏览器底部)
iteration: 2 #选填项,动画重复的次数
- class: card-widget
style: animate__zoomIn
style: animate__zoomIn

# SW-Racing
# https://github.com/Lete114/SW-Racing
SWRacing:
enable: true # 是否使用sw
register: true # true: 注册sw | false: 注销
file: sw.js # sw的文件名
location: head_begin # 插入页面的位置 https://hexo.io/zh-cn/api/injector#entry-lt-string-gt
page: default # 插入到哪些页面 https://hexo.io/zh-cn/api/injector#to-lt-string-gt
3 changes: 2 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,5 @@ gulp.task('generate-service-worker', () => {
});

// 执行 gulp 命令时执行的任务
gulp.task("default",gulp.series("generate-service-worker",gulp.parallel('compress','minify-css', 'minify-html')));
// gulp.task("default",gulp.series("generate-service-worker",gulp.parallel('compress','minify-css', 'minify-html')));
gulp.task("default",gulp.series(gulp.parallel('compress','minify-css', 'minify-html')));
File renamed without changes.
Loading

0 comments on commit 87a527c

Please sign in to comment.