如何更换Hexo中cdn地址

简介:最近jsdelivrCDN无法访问,导致使用了jsdelivrCDN的网页无法加载或乱码,Hexo中NexT主题默认使用jsdelivrCDN,导致使用NexT主题构建的博客无法访问,这里我们需手动修改使用的CDN。

修改CDN

在next主题文件夹下找到以下文件/themes/next/_config.yml,打开文件,找到以下代码:

1
2
3
4
5
6
7
8
9
vendors:
# The CDN provider of NexT internal scripts.
# 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.
# Available values: local | jsdelivr | unpkg | cdnjs
# Dependencies for `plugins: local`: https://github.com/next-theme/plugins
plugins: jsdelivr

jsdelivr修改为cdnjs即可:

1
2
3
4
5
6
7
8
9
vendors:
# The CDN provider of NexT internal scripts.
# 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.
# Available values: local | jsdelivr | unpkg | cdnjs
# Dependencies for `plugins: local`: https://github.com/next-theme/plugins
plugins: cdnjs