hexo-theme-keep
hexo-theme-keep copied to clipboard
cdnjs的选项中,是否可以引入国内的一些厂商?
Issue Checklist | Issue 检查清单
- [X] I am using Keep version
4.2.5or later. (使用 Keep4.2.5或更高版本) - [X] I have already read the Troubleshooting page of Hexo and Keep documents. (已阅读 Hexo 故障处理页面 和 Keep 文档)
- [X] I have already searched for current issues, which does not help me. (已搜索 Issues,对我没有帮助)
Feature Request | 功能需求
我在 https://github.com/XPoet/hexo-theme-keep/blob/master/scripts/helpers/helper.js 源码中看到,cdnjs枚举目前仅支持cloudflare。是否可以引入bootCDN、360CDN等国内速度较快的厂商?
case providerEnum.cdnjs:
urlPrefix = 'https://cdnjs.cloudflare.com/ajax/libs/hexo-theme-keep'
if (tyle === 'js') {
path = path.includes('.min.js') ? path : path.replace('.js', '.min.js')
return `<script src="${urlPrefix}/${version}/${path}"></script>`
} else {
path = path.includes('.min.css') ? path : path.replace('.css', '.min.css')
return `<link rel="stylesheet" href="${urlPrefix}/${version}/${path}">`
}
也就是说urlPrefix支持自定义,比如这样?
urlPrefix = 'https://cdn.bootcdn.net/ajax/libs/hexo-theme-keep'
具体的配置key是否可以在cdn.provider.cdnjs.custom下?
Other Information | 其它信息
No response
挺好的建议,后续会支持自定义cdn 厂商
感觉这个功能cdn.provider.cdnjs.custom 配置项更可靠,因为它不会影响上层配置。如果用 cdn.provider.custom,就可能引入不确定性。比如,如果上层指定的是 jsdelivr,而 custom 用的是 cdnjs,就可能导致无法访问的问题~