From 96c68a93211088ec50ab1c324148b24187b73529 Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Mon, 7 Sep 2020 09:50:12 +0800 Subject: [PATCH] Support cdnjs --- README.md | 2 +- _config.yml | 2 +- docs/ru/README.md | 2 +- docs/zh-CN/README.md | 2 +- scripts/helpers/engine.js | 3 ++- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4b34be1..106d176 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,7 @@ Also, we welcome Issue or PR to our [official-plugins][official-plugins-url]. [docs-installation-url]: https://theme-next.js.org/docs/getting-started/installation.html [docs-configuration-url]: https://theme-next.js.org/docs/getting-started/configuration.html -[docs-custom-files-url]: https://theme-next.js.org/docs/theme-settings/custom-files.html +[docs-custom-files-url]: https://theme-next.js.org/docs/advanced-settings/custom-files.html [docs-update-5-1-x-url]: https://theme-next.js.org/docs/getting-started/update-from-v5.html [gitter-url]: https://gitter.im/hexo-next diff --git a/_config.yml b/_config.yml index 7e863f5..185bad8 100644 --- a/_config.yml +++ b/_config.yml @@ -852,7 +852,7 @@ canvas_ribbon: # Remember to use the https protocol of CDN links when you enable https on your site. vendors: # The CDN provider of NexT internal scripts. - # Available values: local | jsdelivr | unpkg + # Available values: local | jsdelivr | unpkg | cdnjs # Warning: If you are using the latest master branch of NexT, please set `internal: local` internal: local # The default CDN provider of third-party plugins. diff --git a/docs/ru/README.md b/docs/ru/README.md index d7a7944..abc2c55 100644 --- a/docs/ru/README.md +++ b/docs/ru/README.md @@ -151,7 +151,7 @@ Also, we welcome Issue or PR to our [official-plugins][official-plugins-url]. [docs-installation-url]: https://theme-next.js.org/docs/getting-started/installation.html [docs-configuration-url]: https://theme-next.js.org/docs/getting-started/configuration.html -[docs-custom-files-url]: https://theme-next.js.org/docs/theme-settings/custom-files.html +[docs-custom-files-url]: https://theme-next.js.org/docs/advanced-settings/custom-files.html [docs-update-5-1-x-url]: https://theme-next.js.org/docs/getting-started/update-from-v5.html [gitter-url]: https://gitter.im/hexo-next diff --git a/docs/zh-CN/README.md b/docs/zh-CN/README.md index f725e6a..ca11d62 100644 --- a/docs/zh-CN/README.md +++ b/docs/zh-CN/README.md @@ -148,7 +148,7 @@ $ git pull [docs-installation-url]: https://theme-next.js.org/docs/getting-started/installation.html [docs-configuration-url]: https://theme-next.js.org/docs/getting-started/configuration.html -[docs-custom-files-url]: https://theme-next.js.org/docs/theme-settings/custom-files.html +[docs-custom-files-url]: https://theme-next.js.org/docs/advanced-settings/custom-files.html [docs-update-5-1-x-url]: https://theme-next.js.org/docs/getting-started/update-from-v5.html [gitter-url]: https://gitter.im/hexo-next diff --git a/scripts/helpers/engine.js b/scripts/helpers/engine.js index 947eb4e..0e9b827 100644 --- a/scripts/helpers/engine.js +++ b/scripts/helpers/engine.js @@ -21,7 +21,8 @@ hexo.extend.helper.register('next_js', function(file, pjax = false) { const links = { local : this.url_for(`${this.theme.js}/${file}`), jsdelivr: `//cdn.jsdelivr.net/npm/hexo-theme-next@${next_version}/source/js/${file}`, - unpkg : `//unpkg.com/hexo-theme-next@${next_version}/source/js/${file}` + unpkg : `//unpkg.com/hexo-theme-next@${next_version}/source/js/${file}`, + cdnjs : `//cdnjs.cloudflare.com/ajax/libs/hexo-theme-next/${next_version}/${file}` }; const src = links[internal] || links.local; return ``;