From 630ceafcf6bd740e98d352602802c7639174960c Mon Sep 17 00:00:00 2001 From: CCKNBC Date: Sat, 22 Oct 2022 23:17:48 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=8E=20ci(Actions):=20=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E4=BD=BF=E7=94=A8Node16=E7=89=88=E6=9C=AC=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E4=BB=A5=E9=81=BF=E5=85=8D=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/Baidu Sitemap Push.yml | 16 ++++++++-------- .../workflows/Deploy Hexo Public To Pages.yml | 15 ++++++++------- .../Deploy Yuque-Hexo Public To Pages.yml | 14 +++++++------- themes/butterfly/_config.yml | 11 ++++++++++- themes/butterfly/layout/includes/head.pug | 8 -------- .../layout/includes/head/Open_Graph.pug | 18 ++++++++++-------- .../third-party/card-post-count/fb.pug | 2 +- .../includes/third-party/chat/messenger.pug | 2 +- .../third-party/comments/facebook_comments.pug | 2 +- .../includes/third-party/comments/waline.pug | 4 +++- .../layout/includes/third-party/pjax.pug | 2 +- themes/butterfly/package.json | 2 +- themes/butterfly/plugins.yml | 6 +++--- .../source/css/_layout/third-party.styl | 7 ++----- themes/butterfly/source/js/main.js | 2 +- 15 files changed, 57 insertions(+), 54 deletions(-) diff --git a/.github/workflows/Baidu Sitemap Push.yml b/.github/workflows/Baidu Sitemap Push.yml index 55b10e28..0fa18245 100644 --- a/.github/workflows/Baidu Sitemap Push.yml +++ b/.github/workflows/Baidu Sitemap Push.yml @@ -37,11 +37,11 @@ jobs: retain_days: 30 keep_minimum_runs: 6 - - name: Telegram Notification - if: cancelled() == false - uses: xinthink/action-telegram@v1.1 - with: - botToken: ${{ secrets.TG_BOT_TOKEN }} #use bot @BotFather - chatId: ${{ secrets.TG_CHAT_ID }} #use bot @userinfobot - jobStatus: ${{ job.status }} - skipSuccess: true + # - name: Telegram Notification + # if: cancelled() == false + # uses: xinthink/action-telegram@v1.1 + # with: + # botToken: ${{ secrets.TG_BOT_TOKEN }} #use bot @BotFather + # chatId: ${{ secrets.TG_CHAT_ID }} #use bot @userinfobot + # jobStatus: ${{ job.status }} + # skipSuccess: true diff --git a/.github/workflows/Deploy Hexo Public To Pages.yml b/.github/workflows/Deploy Hexo Public To Pages.yml index 25213c73..e278c896 100644 --- a/.github/workflows/Deploy Hexo Public To Pages.yml +++ b/.github/workflows/Deploy Hexo Public To Pages.yml @@ -28,20 +28,21 @@ jobs: check-latest: true cache: "npm" - # - name: Catch Dependencies - # uses: actions/cache@main - # id: cache-dependencies - # with: - # path: node_modules - # key: ${{runner.OS}}-${{hashFiles('**/package-lock.json')}} + - name: Catch Dependencies + uses: actions/cache@main + id: cache-dependencies + with: + path: node_modules + key: ${{runner.OS}}-${{hashFiles('**/package-lock.json')}} - name: Install Dependencies - if: steps.setup-node.outputs.cache-hit != 'true' + if: steps.cache-dependencies.outputs.cache-hit != 'true' run: | npm ci - name: Generate run: | + npm i -g hexo-cli yuque-hexo git clone -b posts git@github.com:ccknbc-actions/blog-butterfly.git source/_posts npm run github diff --git a/.github/workflows/Deploy Yuque-Hexo Public To Pages.yml b/.github/workflows/Deploy Yuque-Hexo Public To Pages.yml index b98920ab..11a2a49c 100644 --- a/.github/workflows/Deploy Yuque-Hexo Public To Pages.yml +++ b/.github/workflows/Deploy Yuque-Hexo Public To Pages.yml @@ -62,6 +62,7 @@ jobs: run: | npm i -g hexo-cli yuque-hexo npm run yuque + # npm i -g hexo-cli yuque-hexo # mkdir -p yuque # yuque-hexo sync @@ -80,14 +81,13 @@ jobs: retention-days: 90 - name: Deploy Markdown Posts To Branch Posts - uses: peaceiris/actions-gh-pages@v3 + uses: JamesIves/github-pages-deploy-action@v4 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_branch: posts - publish_dir: ./source/_posts - user_name: "github-actions[bot]" - user_email: "github-actions[bot]@users.noreply.github.com" - full_commit_message: ${{ github.event.head_commit.message }} + branch: posts + folder: ./source/_posts/语雀/ + git-config-name: "github-actions[bot]" + git-config-email: "github-actions[bot]@users.noreply.github.com" + commit-message: ${{ github.event.head_commit.message }} - name: Deploy Hexo Public To Pages run: | diff --git a/themes/butterfly/_config.yml b/themes/butterfly/_config.yml index 845bd898..90d583f4 100644 --- a/themes/butterfly/_config.yml +++ b/themes/butterfly/_config.yml @@ -857,7 +857,16 @@ lazyload: # Open graph meta tags # https://developers.facebook.com/docs/sharing/webmasters/ -Open_Graph_meta: true +Open_Graph_meta: + enable: true + option: + # twitter_card: + # twitter_image: + # twitter_id: + # twitter_site: + # google_plus: + # fb_admins: + # fb_app_id: # Add the vendor prefixes to ensure compatibility css_prefix: true diff --git a/themes/butterfly/layout/includes/head.pug b/themes/butterfly/layout/includes/head.pug index e9112546..93c3daf9 100644 --- a/themes/butterfly/layout/includes/head.pug +++ b/themes/butterfly/layout/includes/head.pug @@ -7,11 +7,6 @@ - var isSubtitle = config.subtitle ? ' - ' + config.subtitle : '' - var tabTitle = is_home() || !pageTitle ? config.title + isSubtitle : pageTitle + ' | ' + config.title - -- var pageKeywords -- if (page.keywords) pageKeywords = Array.isArray(page.keywords) ? (page.keywords).join(',') : ([]).join(',') || page.keywords -- else if (page.tags && page.tags.length) pageKeywords = page.tags.data.map(function(tag) {return tag.name;}).join(',') -- else pageKeywords = Array.isArray(config.keywords) ? (config.keywords).join(','): ([]).join(',') || config.keywords - var pageAuthor = config.email ? config.author + ',' + config.email : config.author - var pageCopyright = config.copyright || config.author - var themeColorLight = theme.theme_color && theme.theme_color.enable && theme.theme_color.meta_theme_color_light || '#ffffff' @@ -22,13 +17,10 @@ meta(charset='UTF-8') meta(http-equiv="X-UA-Compatible" content="IE=edge") meta(name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no") title= tabTitle -if pageKeywords - meta(name="keywords" content=pageKeywords) meta(name="author" content=pageAuthor) meta(name="copyright" content=pageCopyright) meta(name ="format-detection" content="telephone=no") meta(name="theme-color" content=themeColor) -meta(name="follow.it-verification-code" content="pNLxY9u1rgSk0w57Kk39") if is_post() meta(name="referrer" content="no-referrer") diff --git a/themes/butterfly/layout/includes/head/Open_Graph.pug b/themes/butterfly/layout/includes/head/Open_Graph.pug index 17029854..1d04b470 100644 --- a/themes/butterfly/layout/includes/head/Open_Graph.pug +++ b/themes/butterfly/layout/includes/head/Open_Graph.pug @@ -1,11 +1,13 @@ -if theme.Open_Graph_meta - - let contentType = is_post() ? 'article' : 'website' - - let metaImage = (page.cover || theme.avatar.img) ? full_url_for(page.cover || theme.avatar.img) : '' - - let fb_appId = theme.facebook_comments.app_id || '' - - let fb_admins = theme.facebook_comments.user_id || '' - - != open_graph({type: contentType, image: metaImage, fb_admins: fb_admins, fb_app_id: fb_appId}) - +if theme.Open_Graph_meta.enable + - + let ogOption = Object.assign({ + type: is_post() ? 'article' : 'website', + image: (page.cover || theme.avatar.img) ? full_url_for(page.cover || theme.avatar.img) : '', + fb_admins: theme.facebook_comments.user_id || '', + fb_app_id: theme.facebook_comments.app_id || '', + }, theme.Open_Graph_meta.option) + - + != open_graph(ogOption) else meta(name="description" content=page_description()) diff --git a/themes/butterfly/layout/includes/third-party/card-post-count/fb.pug b/themes/butterfly/layout/includes/third-party/card-post-count/fb.pug index 67d1b853..eee1974b 100644 --- a/themes/butterfly/layout/includes/third-party/card-post-count/fb.pug +++ b/themes/butterfly/layout/includes/third-party/card-post-count/fb.pug @@ -1,4 +1,4 @@ -- const fbSDKVer = 'v14.0' +- const fbSDKVer = 'v15.0' - const fbSDK = theme.messenger.enable ? `https://connect.facebook.net/${theme.facebook_comments.lang}/sdk/xfbml.customerchat.js#xfbml=1&version=${fbSDKVer}` : `https://connect.facebook.net/${theme.facebook_comments.lang}/sdk.js#xfbml=1&version=${fbSDKVer}` script. diff --git a/themes/butterfly/layout/includes/third-party/chat/messenger.pug b/themes/butterfly/layout/includes/third-party/chat/messenger.pug index be405dd2..e7798ee8 100644 --- a/themes/butterfly/layout/includes/third-party/chat/messenger.pug +++ b/themes/butterfly/layout/includes/third-party/chat/messenger.pug @@ -9,7 +9,7 @@ script. window.fbAsyncInit = function() { FB.init({ xfbml: true, - version: 'v14.0' + version: 'v15.0' }); }; diff --git a/themes/butterfly/layout/includes/third-party/comments/facebook_comments.pug b/themes/butterfly/layout/includes/third-party/comments/facebook_comments.pug index a822601d..5d4d399b 100644 --- a/themes/butterfly/layout/includes/third-party/comments/facebook_comments.pug +++ b/themes/butterfly/layout/includes/third-party/comments/facebook_comments.pug @@ -1,4 +1,4 @@ -- const fbSDKVer = 'v14.0' +- const fbSDKVer = 'v15.0' - const fbSDK = theme.messenger.enable ? `https://connect.facebook.net/${theme.facebook_comments.lang}/sdk/xfbml.customerchat.js#xfbml=1&version=${fbSDKVer}` : `https://connect.facebook.net/${theme.facebook_comments.lang}/sdk.js#xfbml=1&version=${fbSDKVer}` script. diff --git a/themes/butterfly/layout/includes/third-party/comments/waline.pug b/themes/butterfly/layout/includes/third-party/comments/waline.pug index 15caa6b2..504a5c2b 100644 --- a/themes/butterfly/layout/includes/third-party/comments/waline.pug +++ b/themes/butterfly/layout/includes/third-party/comments/waline.pug @@ -43,4 +43,6 @@ script. function loadOtherComment () { loadWaline() } - } \ No newline at end of file + } + +//- script(async data-auto-insert="markdown-embed" data-palette="green" data-sibling=".wl-actions" data-url="https://img.gejiba.com/upload" src="//img.gejiba.com/sdk/pup.js") \ No newline at end of file diff --git a/themes/butterfly/layout/includes/third-party/pjax.pug b/themes/butterfly/layout/includes/third-party/pjax.pug index 6dc00b40..24549d42 100644 --- a/themes/butterfly/layout/includes/third-party/pjax.pug +++ b/themes/butterfly/layout/includes/third-party/pjax.pug @@ -7,7 +7,7 @@ if theme.pjax.exclude - let choose = theme.comments.use if choose - if theme.Open_Graph_meta && (choose.includes('Livere') || choose.includes('Utterances') || choose.includes('Giscus')) + if theme.Open_Graph_meta.enable && (choose.includes('Livere') || choose.includes('Utterances') || choose.includes('Giscus')) - pjaxSelectors.unshift('meta[property="og:image"]', 'meta[property="og:title"]', 'meta[property="og:url"]') if choose.includes('Utterances') || choose.includes('Giscus') - pjaxSelectors.unshift('link[rel="canonical"]') diff --git a/themes/butterfly/package.json b/themes/butterfly/package.json index 83560133..bc1c701f 100644 --- a/themes/butterfly/package.json +++ b/themes/butterfly/package.json @@ -1,6 +1,6 @@ { "name": "hexo-theme-butterfly", - "version": "4.5.0-b3", + "version": "4.5.0", "description": "A Simple and Card UI Design theme for Hexo", "main": "package.json", "scripts": { diff --git a/themes/butterfly/plugins.yml b/themes/butterfly/plugins.yml index 0275ceda..ccadde58 100644 --- a/themes/butterfly/plugins.yml +++ b/themes/butterfly/plugins.yml @@ -5,7 +5,7 @@ algolia_search_v4: instantsearch_v4: name: instantsearch.js file: dist/instantsearch.production.min.js - version: 4.46.3 + version: 4.48.1 pjax: name: pjax file: pjax.min.js @@ -42,7 +42,7 @@ waline_js: name: '@waline/client' file: dist/waline.js other_name: waline - version: 2.11.3 + version: 2.13.0 waline_css: name: '@waline/client' file: dist/waline-meta.css @@ -52,7 +52,7 @@ waline_meta_css: name: '@waline/client' file: dist/waline.css other_name: waline - version: 2.11.3 + version: 2.13.0 sharejs: name: butterfly-extsrc file: sharejs/dist/js/social-share.min.js diff --git a/themes/butterfly/source/css/_layout/third-party.styl b/themes/butterfly/source/css/_layout/third-party.styl index 749b9dab..394fb5aa 100644 --- a/themes/butterfly/source/css/_layout/third-party.styl +++ b/themes/butterfly/source/css/_layout/third-party.styl @@ -25,11 +25,8 @@ --waline-theme-color: $button-bg --waline-active-color: $button-hover-color - .vuser - transition: all .5s - - &:hover - transform: rotate(360deg) + .wl-comment-actions > button:not(last-child) + padding-right: 4px if hexo-config('valine.bg') #vcomment diff --git a/themes/butterfly/source/js/main.js b/themes/butterfly/source/js/main.js index 8b3c057a..a80232e2 100644 --- a/themes/butterfly/source/js/main.js +++ b/themes/butterfly/source/js/main.js @@ -477,7 +477,7 @@ document.addEventListener('DOMContentLoaded', function () { // handle some cases typeof utterancesTheme === 'function' && utterancesTheme() typeof changeGiscusTheme === 'function' && changeGiscusTheme() - typeof FB === 'object' && window.loadFBComment() + typeof FB === 'object' && window.loadFBComment && window.loadFBComment() typeof runMermaid === 'function' && window.runMermaid() }, showOrHideBtn: (e) => { // rightside 點擊設置 按鈕 展開