mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-18 18:33:42 +00:00
Update docs & warning
This commit is contained in:
parent
40d6148462
commit
d932e308d4
@ -19,7 +19,6 @@
|
||||
[](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ALinter)
|
||||
[](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ATester)
|
||||
[](https://coveralls.io/github/next-theme/hexo-theme-next)
|
||||
[](https://www.jsdelivr.com/package/npm/hexo-theme-next)
|
||||
|
||||
## Live Preview
|
||||
|
||||
@ -74,7 +73,7 @@ pjax: true
|
||||
|
||||
### Configure CDN
|
||||
|
||||
Third-party plugins are loaded from [jsDelivr](https://www.jsdelivr.com) CDN by default. We also provide other optional CDNs, including the famous [UNPKG](https://unpkg.com) and [CDNJS](https://cdnjs.com).
|
||||
Third-party plugins are loaded from [CDNJS](https://cdnjs.com) CDN by default. We also provide other optional CDNs, including the famous [UNPKG](https://unpkg.com) and [jsDelivr](https://www.jsdelivr.com).
|
||||
|
||||
For example, if you want to use `unpkg` instead of `jsdelivr` as the default CDN provider, you need to edit the following settings in NexT config file:
|
||||
|
||||
@ -141,9 +140,9 @@ Also, we welcome Issue or PR to our [official-plugins][official-plugins-url].
|
||||
|
||||
> Crowdin allows us to translate conveniently the documentation.
|
||||
|
||||
<a href="https://www.jsdelivr.com"><img height="40" src="https://raw.githubusercontent.com/jsdelivr/jsdelivr-media/master/default/svg/jsdelivr-logo-horizontal.svg"></a>
|
||||
<a href="https://cdnjs.com"><img height="40" src="https://raw.githubusercontent.com/cdnjs/brand/master/logo/source/dark-brackets.svg"></a>
|
||||
|
||||
> Thanks jsDelivr for providing public CDN service.
|
||||
> Thanks CDNJS for providing public CDN service.
|
||||
|
||||
[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
|
||||
|
||||
@ -19,7 +19,6 @@
|
||||
[](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ALinter)
|
||||
[](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ATester)
|
||||
[](https://coveralls.io/github/next-theme/hexo-theme-next)
|
||||
[](https://www.jsdelivr.com/package/npm/hexo-theme-next)
|
||||
|
||||
## Демо
|
||||
|
||||
@ -74,7 +73,7 @@ pjax: true
|
||||
|
||||
### Configure CDN
|
||||
|
||||
Third-party plugins are loaded from [jsDelivr](https://www.jsdelivr.com) CDN by default. We also provide other optional CDNs, including the famous [UNPKG](https://unpkg.com) and [CDNJS](https://cdnjs.com).
|
||||
Third-party plugins are loaded from [CDNJS](https://cdnjs.com) CDN by default. We also provide other optional CDNs, including the famous [UNPKG](https://unpkg.com) and [jsDelivr](https://www.jsdelivr.com).
|
||||
|
||||
For example, if you want to use `unpkg` instead of `jsdelivr` as the default CDN provider, you need to edit the following settings in NexT config file:
|
||||
|
||||
@ -141,9 +140,9 @@ Also, we welcome Issue or PR to our [official-plugins][official-plugins-url].
|
||||
|
||||
> Crowdin allows us to translate conveniently the documentation.
|
||||
|
||||
<a href="https://www.jsdelivr.com"><img height="40" src="https://raw.githubusercontent.com/jsdelivr/jsdelivr-media/master/default/svg/jsdelivr-logo-horizontal.svg"></a>
|
||||
<a href="https://cdnjs.com"><img height="40" src="https://raw.githubusercontent.com/cdnjs/brand/master/logo/source/dark-brackets.svg"></a>
|
||||
|
||||
> Thanks jsDelivr for providing public CDN service.
|
||||
> Thanks CDNJS for providing public CDN service.
|
||||
|
||||
[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
|
||||
|
||||
@ -19,7 +19,6 @@
|
||||
[](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ALinter)
|
||||
[](https://github.com/next-theme/hexo-theme-next/actions?query=workflow%3ATester)
|
||||
[](https://coveralls.io/github/next-theme/hexo-theme-next)
|
||||
[](https://www.jsdelivr.com/package/npm/hexo-theme-next)
|
||||
|
||||
## 即时预览
|
||||
|
||||
@ -74,7 +73,7 @@ pjax: true
|
||||
|
||||
### 设置 CDN
|
||||
|
||||
第三方插件默认通过 [jsDelivr](https://www.jsdelivr.com) CDN 服务加载。我们也提供了其它的 CDN 服务供选择,包括著名的 [UNPKG](https://unpkg.com) 和 [CDNJS](https://cdnjs.com)。
|
||||
第三方插件默认通过 [CDNJS](https://cdnjs.com) CDN 服务加载。我们也提供了其它的 CDN 服务供选择,包括著名的 [UNPKG](https://unpkg.com) 和 [jsDelivr](https://www.jsdelivr.com)。
|
||||
|
||||
例如,你想要使用 `unpkg` 代替 `jsdelivr` 作为默认的 CDN 提供商,你需要在 NexT 配置文件中进行如下设置:
|
||||
|
||||
@ -141,9 +140,9 @@ $ git pull
|
||||
|
||||
> Crowdin 容许我们方便地翻译文档。
|
||||
|
||||
<a href="https://www.jsdelivr.com"><img height="40" src="https://raw.githubusercontent.com/jsdelivr/jsdelivr-media/master/default/svg/jsdelivr-logo-horizontal.svg"></a>
|
||||
<a href="https://cdnjs.com"><img height="40" src="https://raw.githubusercontent.com/cdnjs/brand/master/logo/source/dark-brackets.svg"></a>
|
||||
|
||||
> jsDelivr 提供了 CDN 服务。
|
||||
> 感谢 CDNJS 提供的 CDN 服务。
|
||||
|
||||
[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
|
||||
|
||||
@ -41,10 +41,14 @@ module.exports = hexo => {
|
||||
local : url_for.call(hexo, `lib/${name}/${file}`),
|
||||
custom : vendors.custom_cdn_url
|
||||
});
|
||||
let { plugins = 'jsdelivr' } = vendors;
|
||||
if (plugins === 'local' && typeof internal === 'undefined') plugins = 'jsdelivr';
|
||||
let { plugins = 'cdnjs' } = vendors;
|
||||
if (plugins === 'local' && typeof internal === 'undefined') {
|
||||
hexo.log.warn('Dependencies for `plugins: local` not found. The default CDN provider CDNJS is used instead.');
|
||||
hexo.log.warn('Run `npm install @next-theme/plugins` in Hexo site root directory to install the plugin.');
|
||||
plugins = 'cdnjs';
|
||||
}
|
||||
vendors[key] = {
|
||||
url : links[plugins] || links.jsdelivr,
|
||||
url : links[plugins] || links.cdnjs,
|
||||
integrity: value.integrity
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user