mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-20 19:02:33 +00:00
Support cdnjs
This commit is contained in:
parent
4b8a17b8e8
commit
96c68a9321
@ -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
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 `<script ${pjax ? 'data-pjax ' : ''}src="${src}"></script>`;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user