Jsdelivr 是一个很好用的 CDN 服务商,由一些不知名的原因,jsdelivr 在国内的备案被取消了,所以导致博客时不时抽风,这里记录以下 next 主题更换 cdn
NexT 在 8.9.0 版本增加了对于自定义 CDN 的选项,我们根据文档提示,我们需要在主题配置文件下的vendors.custom_cdn_url下添加 cdn 链接,如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
初始配置: vendors: # The CDN provider of NexT internal scripts. # Available values: local | jsdelivr | unpkg | cdnjs | custom # 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 | custom # Dependencies for `plugins: local`: https://github.com/next-theme/plugins plugins: jsdelivr # Custom CDN URL # For example: # custom_cdn_url: https://cdn.jsdelivr.net/npm/${npm_name}@${version}/${minified} # custom_cdn_url: https://cdnjs.cloudflare.com/ajax/libs/${cdnjs_name}/${version}/${cdnjs_file} custom_cdn_url: