From e56354c152c401933f4d40c8cf7a905e423ec3a8 Mon Sep 17 00:00:00 2001 From: Tikas Date: Fri, 27 May 2022 00:55:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20jsdelivr=20=E7=9A=84?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E4=B8=BA=20fastly=20(#81)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _config.yml | 46 +++++++++---------- layout/404.ejs | 2 +- layout/_partial/head.ejs | 4 +- .../_partial/main/article/article_footer.ejs | 8 ++-- layout/_partial/main/post_list/paginator.ejs | 4 +- layout/_partial/main/post_list/post_card.ejs | 2 +- .../plugins/comments/valine/script.ejs | 2 +- layout/_partial/scripts/index.ejs | 2 +- npm-publish.sh | 2 +- source/css/_custom.styl | 2 +- source/css/_layout/tag-plugins/frame.styl | 2 +- source/js/plugins/friends.js | 2 +- source/js/plugins/sites.js | 4 +- 13 files changed, 41 insertions(+), 41 deletions(-) diff --git a/_config.yml b/_config.yml index c3507d3..d690a65 100755 --- a/_config.yml +++ b/_config.yml @@ -110,7 +110,7 @@ comments: theme: preferred-color-scheme label: valine: - js: https://cdn.jsdelivr.net/gh/XuxuGood/simple-blog-cdn@main/js/Valine.min.js + js: https://fastly.jsdelivr.net/gh/XuxuGood/simple-blog-cdn@main/js/Valine.min.js appId: # your appId appKey: # your appKey placeholder: @@ -134,7 +134,7 @@ comments: # Twikoo # https://twikoo.js.org/ twikoo: - js: https://cdn.jsdelivr.net/npm/twikoo@1.4.0/dist/twikoo.all.min.js # 建议锁定版本 + js: https://fastly.jsdelivr.net/npm/twikoo@1.4.0/dist/twikoo.all.min.js # 建议锁定版本 envId: https://xxx # vercel函数 waline: js: https://unpkg.com/@waline/client@v2/dist/waline.js @@ -187,16 +187,16 @@ comments: footer: social: # github: - # icon: '' + # icon: '' # url: / # music: - # icon: '' + # icon: '' # url: / # unsplash: - # icon: '' + # icon: '' # url: / # comments: - # icon: '' + # icon: '' # url: /about/#comments sitemap: # '博客': @@ -234,11 +234,11 @@ tag_plugins: prefix: https://s2.loli.net/2022/01/04/UvHcsa73jQPnobq.png # {% emoji %} emoji: - default: https://cdn.jsdelivr.net/gh/volantis-x/cdn-emoji/qq/%s.gif - twemoji: https://cdn.jsdelivr.net/gh/twitter/twemoji/assets/svg/%s.svg - qq: https://cdn.jsdelivr.net/gh/volantis-x/cdn-emoji/qq/%s.gif - aru: https://cdn.jsdelivr.net/gh/volantis-x/cdn-emoji/aru-l/%s.gif - tieba: https://cdn.jsdelivr.net/gh/volantis-x/cdn-emoji/tieba/%s.png + default: https://fastly.jsdelivr.net/gh/volantis-x/cdn-emoji/qq/%s.gif + twemoji: https://fastly.jsdelivr.net/gh/twitter/twemoji/assets/svg/%s.svg + qq: https://fastly.jsdelivr.net/gh/volantis-x/cdn-emoji/qq/%s.gif + aru: https://fastly.jsdelivr.net/gh/volantis-x/cdn-emoji/aru-l/%s.gif + tieba: https://fastly.jsdelivr.net/gh/volantis-x/cdn-emoji/tieba/%s.png # {% image %} image: fancybox: # true, false @@ -248,7 +248,7 @@ tag_plugins: plugins: ## required plugins ## # jquery - jquery: https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js + jquery: https://fastly.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js # issues api sitesjs: /js/plugins/sites.js @@ -259,20 +259,20 @@ plugins: preload: enable: true service: flying_pages # instant_page, flying_pages - instant_page: https://cdn.jsdelivr.net/gh/volantis-x/cdn-volantis@4.1.2/js/instant_page.js - flying_pages: https://cdn.jsdelivr.net/gh/gijo-varghese/flying-pages@2.1.2/flying-pages.min.js + instant_page: https://fastly.jsdelivr.net/gh/volantis-x/cdn-volantis@4.1.2/js/instant_page.js + flying_pages: https://fastly.jsdelivr.net/gh/gijo-varghese/flying-pages@2.1.2/flying-pages.min.js # image lazyload # https://www.npmjs.com/package/vanilla-lazyload lazyload: enable: true # [hexo clean && hexo s] is required after changing this value. - js: https://cdn.jsdelivr.net/npm/vanilla-lazyload@17.3.1/dist/lazyload.min.js + js: https://fastly.jsdelivr.net/npm/vanilla-lazyload@17.3.1/dist/lazyload.min.js transition: blur # blur, fade # https://scrollrevealjs.org/api/reveal.html scrollreveal: enable: #true - js: https://cdn.jsdelivr.net/npm/scrollreveal@4.0.9/dist/scrollreveal.min.js + js: https://fastly.jsdelivr.net/npm/scrollreveal@4.0.9/dist/scrollreveal.min.js distance: 8px duration: 500 # ms interval: 100 # ms @@ -282,8 +282,8 @@ plugins: # available for {% image xxx %} fancybox: enable: true - js: https://cdn.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.umd.js - css: https://cdn.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.css + js: https://fastly.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.umd.js + css: https://fastly.jsdelivr.net/npm/@fancyapps/ui@4.0/dist/fancybox.css # 可以处理评论区的图片(不支持 iframe 类评论系统)例如: # 使用valine评论可以写: .vcontent img:not(.vemoji) # 使用twikoo评论可以写: .tk-content img:not([class*="emo"]) @@ -312,12 +312,12 @@ style: dark: '#313438' animated_avatar: animate: auto # auto, always - background: https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.2/avatar/round/rainbow64@3x.webp + background: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.2/avatar/round/rainbow64@3x.webp codeblock: scrollbar: 4px default: - avatar: https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/avatar/round/3442075.svg - link: https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/link/8f277b4ee0ecd.svg - cover: https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/cover/76b86c0226ffd.svg - image: https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/image/2659360.svg + avatar: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/avatar/round/3442075.svg + link: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/link/8f277b4ee0ecd.svg + cover: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/cover/76b86c0226ffd.svg + image: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/image/2659360.svg diff --git a/layout/404.ejs b/layout/404.ejs index 90cf4cd..ad50f7a 100755 --- a/layout/404.ejs +++ b/layout/404.ejs @@ -6,7 +6,7 @@ page.header = false; page.robots = 'none'; %>
-

404

+

404

<%- __('page.error.what') %> diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index fc2a465..6c894be 100755 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -49,8 +49,8 @@ function og_args() { <%- generate_robots() %> - - + + diff --git a/layout/_partial/main/article/article_footer.ejs b/layout/_partial/main/article/article_footer.ejs index 9f09964..37e2938 100644 --- a/layout/_partial/main/article/article_footer.ejs +++ b/layout/_partial/main/article/article_footer.ejs @@ -85,13 +85,13 @@ function layoutDiv() { } el += '>'; if (item == 'wechat') { - el += ''; + el += ''; } else if (item == 'weibo') { - el += ''; + el += ''; } else if (item == 'email') { - el += ''; + el += ''; } else if (item == 'link') { - el += ''; + el += ''; } el += ''; } diff --git a/layout/_partial/main/post_list/paginator.ejs b/layout/_partial/main/post_list/paginator.ejs index b63b4ec..3d39188 100644 --- a/layout/_partial/main/post_list/paginator.ejs +++ b/layout/_partial/main/post_list/paginator.ejs @@ -1,13 +1,13 @@ <% if (is_home() && page.total > 1) { %>

- +
<%- page.current %><%- page.total %>
- +
<% } %> diff --git a/layout/_partial/main/post_list/post_card.ejs b/layout/_partial/main/post_list/post_card.ejs index 285bd6f..0d2ef9b 100755 --- a/layout/_partial/main/post_list/post_card.ejs +++ b/layout/_partial/main/post_list/post_card.ejs @@ -80,7 +80,7 @@ function div_default() { } } if (post.pin) { - el += ''; + el += ''; } el += ''; el += '
'; diff --git a/layout/_partial/plugins/comments/valine/script.ejs b/layout/_partial/plugins/comments/valine/script.ejs index 300a298..14e8b87 100644 --- a/layout/_partial/plugins/comments/valine/script.ejs +++ b/layout/_partial/plugins/comments/valine/script.ejs @@ -35,7 +35,7 @@ el: '#valine_container', path: path, placeholder: placeholder, - emojiCDN: 'https://cdn.jsdelivr.net/gh/volantis-x/cdn-emoji/valine/', + emojiCDN: 'https://fastly.jsdelivr.net/gh/volantis-x/cdn-emoji/valine/', emojiMaps: getEmojiMaps(), })); }); diff --git a/layout/_partial/scripts/index.ejs b/layout/_partial/scripts/index.ejs index 77733d6..7f26f83 100644 --- a/layout/_partial/scripts/index.ejs +++ b/layout/_partial/scripts/index.ejs @@ -103,7 +103,7 @@ // required plugins (only load if needs) stellar.plugins = { - jQuery: '<%- url_for(theme.plugins.jquery || "https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js") %>', + jQuery: '<%- url_for(theme.plugins.jquery || "https://fastly.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js") %>', sitesjs: '<%- url_for(theme.plugins.sitesjs) %>', friendsjs: '<%- url_for(theme.plugins.friendsjs) %>', }; diff --git a/npm-publish.sh b/npm-publish.sh index 7a44bd5..3a6236a 100644 --- a/npm-publish.sh +++ b/npm-publish.sh @@ -21,7 +21,7 @@ function prepare() { sub=${VERSION#*.} sub=${sub%%.*} jsdelivr=$main'.'$sub - sed -i "" "s/\(cdn.jsdelivr.net\/npm\/hexo-theme-stellar@[^/]\{1,\}\)/cdn.jsdelivr.net\/npm\/hexo-theme-stellar@${jsdelivr}/g" '_config.yml' + sed -i "" "s/\(fastly.jsdelivr.net\/npm\/hexo-theme-stellar@[^/]\{1,\}\)/fastly.jsdelivr.net\/npm\/hexo-theme-stellar@${jsdelivr}/g" '_config.yml' } # 提交 diff --git a/source/css/_custom.styl b/source/css/_custom.styl index 96333f2..6780c77 100644 --- a/source/css/_custom.styl +++ b/source/css/_custom.styl @@ -32,7 +32,7 @@ $dark-site-bg-mobile = black // @font-face // font-family: 'Dosis' -// src: url('https://cdn.jsdelivr.net/gh/volantis-x/cdn-fonts@20.5.30/Dosis/Dosis-Medium.ttf') +// src: url('https://fastly.jsdelivr.net/gh/volantis-x/cdn-fonts@20.5.30/Dosis/Dosis-Medium.ttf') // font-weight: normal // font-style: normal diff --git a/source/css/_layout/tag-plugins/frame.styl b/source/css/_layout/tag-plugins/frame.styl index 7ce15d9..4a1534c 100644 --- a/source/css/_layout/tag-plugins/frame.styl +++ b/source/css/_layout/tag-plugins/frame.styl @@ -27,7 +27,7 @@ margin-top: 19px margin-bottom: 20px .frame - background-image: url(https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/frame/iphone11.svg); + background-image: url(https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/frame/iphone11.svg); width: 329px height: 658px &[focus='top'] diff --git a/source/js/plugins/friends.js b/source/js/plugins/friends.js index e5189bc..c15b700 100644 --- a/source/js/plugins/friends.js +++ b/source/js/plugins/friends.js @@ -77,7 +77,7 @@ $(function () { cfg.el = el; cfg.api = api; cfg.class = el.getAttribute('class'); - cfg.avatar = 'https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/avatar/round/3442075.svg'; + cfg.avatar = 'https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/avatar/round/3442075.svg'; friendsjs.layout(cfg); } }); diff --git a/source/js/plugins/sites.js b/source/js/plugins/sites.js index c798af4..540c177 100644 --- a/source/js/plugins/sites.js +++ b/source/js/plugins/sites.js @@ -80,8 +80,8 @@ $(function () { cfg.class = el.getAttribute('class'); cfg.el = el; cfg.api = api; - cfg.avatar = 'https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/link/8f277b4ee0ecd.svg'; - cfg.screenshot = 'https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/cover/76b86c0226ffd.svg'; + cfg.avatar = 'https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/link/8f277b4ee0ecd.svg'; + cfg.screenshot = 'https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/cover/76b86c0226ffd.svg'; sitesjs.layout(cfg); } });