Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

希望能分开providers中的cdn #1035

Open
Nofated095 opened this issue Feb 17, 2022 · 0 comments
Open

希望能分开providers中的cdn #1035

Nofated095 opened this issue Feb 17, 2022 · 0 comments
Labels
feature:core Feature request that affects layout, styles, scripts, etc.

Comments

@Nofated095
Copy link

问题

我按照文档中的教程将某cdn提供商的地址改编成了 https://some.cdn.domain.name/${package}/${version}/${filename} 这种格式。但是往往一个cdn站点由于更新不及时、cdn库量较少无法涵盖hexo-theme-icarus所需的项目。

解决方案

可以将配置文件中的 providers 中 cdn 项拆开,一个js一个链接,可以更加灵活的去获取。

类似于

providers:
   cdn:
      js1: https://example0.com/path/to/js1.min.js
      js2: https://example1.com/path/to/js2.min.js
      jsx: https://example2.com/path/to/jsx.min.js

或者仍然保留cdn这个项目,可以在此基础上自定义部分地址,就是除了js1、js2来使用特定链接加载,剩下的项目从cdn地址加载。可能需要添加js名称检测

providers:
   cdn: '[cdnjs]https://example.com/${package}/${version}/${filename}'
      js1: https://example.com/path/to/js1.min.js
      js2: https://example.com/path/to/js2.min.js

额外

这个功能类似于hexo-theme-next配置文件中vendors项目

问题

这个功能可能需要在hexo-theme-icarus更新时额外去更新vendors库,可能会导致加载的js版本不同出错。

@ppoffice ppoffice added the feature:core Feature request that affects layout, styles, scripts, etc. label Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:core Feature request that affects layout, styles, scripts, etc.
Projects
None yet
Development

No branches or pull requests

2 participants