theme-next / hexo-theme-next

Elegant and powerful theme for Hexo.
https://theme-next.org
Other
8.17k stars 2.05k forks source link

博客页面一片空白,什么也显示不出来 #1707

Closed SunJunge08 closed 2 years ago

SunJunge08 commented 2 years ago

问题已经解决了,方案在 https://github.com/theme-next/hexo-theme-next/issues/1707#issuecomment-1133787959 中。 另外,下面一大堆没用的内容被我删掉了。只留下了问题。


Please follow this Issue template to provide relevant information, such as source code repositories, blog links, and screenshots, which will help us investigate. 请按照此 Issue 模版提供相关信息,例如源码仓库、博客链接和屏幕截图,这将有助于我们进行调查。

Issue Checklist


Expected behavior

博客的内容应该正常显示,像这样:(我在网上找的 都是别人搭建的)

image

image

地址分别是: https://huangpiao.tech/ http://www.adanblog.com/hexo/fbf5310d.html

Actual behavior

我的博客页面一片空白,什么也显示不出来。有的时候连侧边栏的那几个字也没了。

image

奇怪的是,我文章中的内容都在,我可以选中它们然后复制,但是他们就像是隐形了一样,完全看不到。而且换了几个浏览器来打开页面,把 ublock origin 关掉,把 tampermonkey 关掉等操作都没用,可以排除不是浏览器而是博客本身的原因。

此外,我在查看这里的 issues 时,发现别人搭建的博客点进去也和我的一样,都是空白的,就像这样:

image

image

image

image

地址分别为: https://zerobio.github.io/ https://www.studentwei.xyz/ https://www.threegates.net/ https://coder-jason.cn/

Steps to reproduce the behavior

  1. hexo clean
$ hexo clean
INFO  Validating config
INFO  Deleted database.
INFO  Deleted public folder.
  1. hexo g

没有问题

  1. hexo s
$ hexo s
INFO  Validating config
INFO  Start processing
INFO  Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.
(node:17156) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:17156) Warning: Accessing non-existent property 'column' of module exports inside circular dependency
(node:17156) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency
(node:17156) Warning: Accessing non-existent property 'lineno' of module exports inside circular dependency
(node:17156) Warning: Accessing non-existent property 'column' of module exports inside circular dependency
(node:17156) Warning: Accessing non-existent property 'filename' of module exports inside circular dependency
INFO  Have a nice day
  1. hexo d

没有问题。

welcome[bot] commented 2 years ago

Thanks for opening this issue, maintainers will get back to you as soon as possible!

freedomgod commented 2 years ago

F12检查过吗,有没有可能是jsdelivr的文件加载不了?

SunJunge08 commented 2 years ago

F12检查过吗,有没有可能是jsdelivr的文件加载不了?

怎么检查?能详细说一下吗?

duchengyao commented 2 years ago

F12检查过吗,有没有可能是jsdelivr的文件加载不了?

我发现我的 blog 也存在 jsdelivr 加载不了卡住的问题。 怎么解决啊,我尝试在config里把 plugins 设置为: local,但依然会加载jsdelivr并卡住。

SunJunge08 commented 2 years ago

看来确实是 jsdelivr 的问题,但是该怎么修复呢?

freedomgod commented 2 years ago

目前jsdelivr在国内用不了了,感觉只能想办法把依赖的文件下载到本地,再部署到其他CDN上,但是貌似科学上网也访问不了jsd,可能是我用的梯子不行;另一个就是找其他同样文件的CDN代替jsd。我也还没解决这个问题。

但在jsdelivr项目的这个issues下看到一个回答,说这个jsdelivr-auto-fallback好像能解决,但我还没试过,不清楚是否有用。

SunJunge08 commented 2 years ago

目前jsdelivr在国内用不了了,感觉只能想办法把依赖的文件下载到本地,再部署到其他CDN上,但是貌似科学上网也访问不了jsd,可能是我用的梯子不行;另一个就是找其他同样文件的CDN代替jsd。我也还没解决这个问题。

但在jsdelivr项目的这个issues下看到一个回答,说这个jsdelivr-auto-fallback好像能解决,但我还没试过,不清楚是否有用。

感谢你的回答,我现在也正在寻找解决这一问题的方法。

你说的那个 jsdelivr-auto-fallback 我也看到了,但是下面有人评论说它没有用。我也没去尝试,如果其他方法都不行的话我再去试试。

我感觉用其他 cdn 代替 jsd 能行。刚才我正在修改 _config.yml 中的 cdn 地址。大部分用的是 https://cdn.baomitu.com/ ,现在还没完成。修改后的内容如下:

#! ---------------------------------------------------------------
#! DO NOT EDIT THE FOLLOWING SETTINGS
#! UNLESS YOU KNOW WHAT YOU ARE DOING
#! See: https://theme-next.org/docs/advanced-settings
#! ---------------------------------------------------------------

# Script Vendors. Set a CDN address for the vendor you want to customize.
# Be aware that you would better use the same version as internal ones to avoid potential problems.
# Remember to use the https protocol of CDN files when you enable https on your site.
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
  # plugins: loli
  plugins: local

  # Internal version: 3.1.0
  # anime: //cdn.jsdelivr.net/npm/animejs@3.1.0/lib/anime.min.js
  anime: //lib.baomitu.com/animejs/3.1.0/anime.min.js

  # Internal version: 5.13.0
  # fontawesome: //cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5/css/all.min.css
  # fontawesome: //cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css
  fontawesome: //lib.baomitu.com/font-awesome/5.13.0/css/all.min.css

  # MathJax
  # mathjax: //cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
  mathjax:  //lib.baomitu.com/mathjax/3.2.0/es5/tex-mml-chtml.js

  # KaTeX
  # katex: //cdn.jsdelivr.net/npm/katex@0/dist/katex.min.css
  # katex: //cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/katex.min.css
  # copy_tex_js: //cdn.jsdelivr.net/npm/katex@0/dist/contrib/copy-tex.min.js
  # copy_tex_css: //cdn.jsdelivr.net/npm/katex@0/dist/contrib/copy-tex.min.css
  katex: //lib.baomitu.com/KaTeX/0.15.3/katex.min.css
  copy_tex_js: //lib.baomitu.com/KaTeX/0.15.3/contrib/copy-tex.min.js
  copy_tex_css: //lib.baomitu.com/KaTeX/0.15.3/contrib/copy-tex.min.css

  # Internal version: 0.2.8
  # pjax: //cdn.jsdelivr.net/gh/theme-next/theme-next-pjax@0/pjax.min.js
  pjax: //cdn.staticfile.org/next-theme-pjax/0.4.0/pjax.min.js

  # FancyBox
  # jquery: //cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js
  # fancybox: //cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.js
  # fancybox_css: //cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.css
  jquery: //lib.baomitu.com/jquery/latest/jquery.min.js
  fancybox: //lib.baomitu.com/fancybox/latest/jquery.fancybox.min.js
  fancybox_css: //lib.baomitu.com/fancybox/latest/jquery.fancybox.min.css

  # Medium-zoom
  # mediumzoom: //cdn.jsdelivr.net/npm/medium-zoom@1/dist/medium-zoom.min.js
  mediumzoom: //cdn.bootcdn.net/ajax/libs/medium-zoom/1.0.6/medium-zoom.min.js

  # Lazyload
  # lazyload: //cdn.jsdelivr.net/npm/lozad@1/dist/lozad.min.js
  # lazyload: //cdnjs.cloudflare.com/ajax/libs/lozad.js/1.14.0/lozad.min.js
  lazyload: //lib.baomitu.com/lozad.js/1.14.0/lozad.min.js

  # Pangu
  # pangu: //cdn.jsdelivr.net/npm/pangu@4/dist/browser/pangu.min.js
  # pangu: //cdnjs.cloudflare.com/ajax/libs/pangu/4.0.7/pangu.min.js
  pangu: //lib.baomitu.com/pangu/4.0.7/pangu.min.js

  # Quicklink
  # quicklink: //cdn.jsdelivr.net/npm/quicklink@1/dist/quicklink.umd.js
  quicklink: //lib.baomitu.com/quicklink/latest/quicklink.umd.js

  # DisqusJS
  # disqusjs_js: //cdn.jsdelivr.net/npm/disqusjs@1/dist/disqus.js
  # disqusjs_css: //cdn.jsdelivr.net/npm/disqusjs@1/dist/disqusjs.css
  disqusjs_js: //lib.baomitu.com/disqusjs/latest/disqus.js
  disqusjs_css: //lib.baomitu.com/disqusjs/latest/disqusjs.css

  # Valine
  # valine: //cdn.jsdelivr.net/npm/valine@1/dist/Valine.min.js
  # valine: //cdnjs.cloudflare.com/ajax/libs/valine/1.3.10/Valine.min.js
  valine: //lib.baomitu.com/valine/1.3.10/Valine.min.js

  # Gitalk
  # gitalk_js: //cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js
  # gitalk_css: //cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.css
  gitalk_js: //lib.baomitu.com/gitalk/latest/gitalk.min.js
  gitalk_css: //lib.baomitu.com/gitalk/latest/gitalk.min.css

  # Algolia Search
  # algolia_search: //cdn.jsdelivr.net/npm/algoliasearch@4/dist/algoliasearch-lite.umd.js
  # instant_search: //cdn.jsdelivr.net/npm/instantsearch.js@4/dist/instantsearch.production.min.js
  algolia_search: //lib.baomitu.com/algoliasearch/latest/algoliasearch-lite.umd.js
  instant_search: //lib.baomitu.com/instantsearch.js/latest/instantsearch.production.min.js

  # Mermaid
  # mermaid: //cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js
  # mermaid: //cdnjs.cloudflare.com/ajax/libs/mermaid/8.4.8/mermaid.min.js
  mermaid: //lib.baomitu.com/mermaid/8.4.8/mermaid.min.js

  # Internal version: 1.2.1
  # velocity: //cdn.jsdelivr.net/npm/velocity-animate@1/velocity.min.js
  # velocity: //cdnjs.cloudflare.com/ajax/libs/velocity/1.2.1/velocity.min.js
  # velocity_ui: //cdn.jsdelivr.net/npm/velocity-animate@1/velocity.ui.min.js
  # velocity_ui: //cdnjs.cloudflare.com/ajax/libs/velocity/1.2.1/velocity.ui.min.js
  velocity: //lib.baomitu.com/velocity/1.2.1/velocity.min.js
  velocity_ui: //lib.baomitu.com/velocity/1.2.1/velocity.ui.min.js

  # Internal version: 1.0.2
  # pace: //cdn.jsdelivr.net/npm/pace-js@1/pace.min.js
  # pace: //cdnjs.cloudflare.com/ajax/libs/pace/1.0.2/pace.min.js
  # pace_css: //cdn.jsdelivr.net/npm/pace-js@1/themes/blue/pace-theme-minimal.css
  # pace_css: //cdnjs.cloudflare.com/ajax/libs/pace/1.0.2/themes/blue/pace-theme-minimal.min.css
  pace: //lib.baomitu.com/pace/1.0.2/pace.min.js
  pace_css: //lib.baomitu.com/pace/1.0.2/themes/blue/pace-theme-minimal.min.css

  # Internal version: 1.0.0
  # three: //cdn.jsdelivr.net/gh/theme-next/theme-next-three@1/three.min.js
  # three_waves: //cdn.jsdelivr.net/gh/theme-next/theme-next-three@1/three-waves.min.js
  # canvas_lines: //cdn.jsdelivr.net/gh/theme-next/theme-next-three@1/canvas_lines.min.js
  # canvas_sphere: //cdn.jsdelivr.net/gh/theme-next/theme-next-three@1/canvas_sphere.min.js
  three: 
  three_waves:
  canvas_lines:
  canvas_sphere:

  # Internal version: 1.0.0
  # canvas_ribbon: //cdn.jsdelivr.net/gh/theme-next/theme-next-canvas-ribbon@1/canvas-ribbon.js
  canvas_ribbon:

但是,我始终找不到 theme-next-three 这几个文件,好像是只有 jsd 才有。不知道你有没有解决办法。

SunJunge08 commented 2 years ago

除了 theme-next-threetheme-next-canvas-ribbon 这两个我没找到可以替换的 CDN ,其他的我都替换为了可用的 CDN。

然后我 hexo g 和 hexo s 了一下,居然能够正常显示了!

而且上面那两个东西好像也没什么用,网页上的内容都能正常显示。

SunJunge08 commented 2 years ago

问题解决力(喜 😆

code-anan commented 2 years ago

你好 请问一下怎么解决的 我人麻了

znyan commented 2 years ago

目前jsdelivr在国内用不了了,感觉只能想办法把依赖的文件下载到本地,再部署到其他CDN上,但是貌似科学上网也访问不了jsd,可能是我用的梯子不行;另一个就是找其他同样文件的CDN代替jsd。我也还没解决这个问题。 但在jsdelivr项目的这个issues下看到一个回答,说这个jsdelivr-auto-fallback好像能解决,但我还没试过,不清楚是否有用。

感谢你的回答,我现在也正在寻找解决这一问题的方法。

你说的那个 jsdelivr-auto-fallback 我也看到了,但是下面有人评论说它没有用。我也没去尝试,如果其他方法都不行的话我再去试试。

我感觉用其他 cdn 代替 jsd 能行。刚才我正在修改 _config.yml 中的 cdn 地址。大部分用的是 ,现在还没完成。修改后的内容如下:https://cdn.baomitu.com/

#! ---------------------------------------------------------------
#! DO NOT EDIT THE FOLLOWING SETTINGS
#! UNLESS YOU KNOW WHAT YOU ARE DOING
#! See: https://theme-next.org/docs/advanced-settings
#! ---------------------------------------------------------------

# Script Vendors. Set a CDN address for the vendor you want to customize.
# Be aware that you would better use the same version as internal ones to avoid potential problems.
# Remember to use the https protocol of CDN files when you enable https on your site.
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
  # plugins: loli
  plugins: local

  # Internal version: 3.1.0
  # anime: //cdn.jsdelivr.net/npm/animejs@3.1.0/lib/anime.min.js
  anime: //lib.baomitu.com/animejs/3.1.0/anime.min.js

  # Internal version: 5.13.0
  # fontawesome: //cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5/css/all.min.css
  # fontawesome: //cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css
  fontawesome: //lib.baomitu.com/font-awesome/5.13.0/css/all.min.css

  # MathJax
  # mathjax: //cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
  mathjax:  //lib.baomitu.com/mathjax/3.2.0/es5/tex-mml-chtml.js

  # KaTeX
  # katex: //cdn.jsdelivr.net/npm/katex@0/dist/katex.min.css
  # katex: //cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/katex.min.css
  # copy_tex_js: //cdn.jsdelivr.net/npm/katex@0/dist/contrib/copy-tex.min.js
  # copy_tex_css: //cdn.jsdelivr.net/npm/katex@0/dist/contrib/copy-tex.min.css
  katex: //lib.baomitu.com/KaTeX/0.15.3/katex.min.css
  copy_tex_js: //lib.baomitu.com/KaTeX/0.15.3/contrib/copy-tex.min.js
  copy_tex_css: //lib.baomitu.com/KaTeX/0.15.3/contrib/copy-tex.min.css

  # Internal version: 0.2.8
  # pjax: //cdn.jsdelivr.net/gh/theme-next/theme-next-pjax@0/pjax.min.js
  pjax: //cdn.staticfile.org/next-theme-pjax/0.4.0/pjax.min.js

  # FancyBox
  # jquery: //cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js
  # fancybox: //cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.js
  # fancybox_css: //cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.css
  jquery: //lib.baomitu.com/jquery/latest/jquery.min.js
  fancybox: //lib.baomitu.com/fancybox/latest/jquery.fancybox.min.js
  fancybox_css: //lib.baomitu.com/fancybox/latest/jquery.fancybox.min.css

  # Medium-zoom
  # mediumzoom: //cdn.jsdelivr.net/npm/medium-zoom@1/dist/medium-zoom.min.js
  mediumzoom: //cdn.bootcdn.net/ajax/libs/medium-zoom/1.0.6/medium-zoom.min.js

  # Lazyload
  # lazyload: //cdn.jsdelivr.net/npm/lozad@1/dist/lozad.min.js
  # lazyload: //cdnjs.cloudflare.com/ajax/libs/lozad.js/1.14.0/lozad.min.js
  lazyload: //lib.baomitu.com/lozad.js/1.14.0/lozad.min.js

  # Pangu
  # pangu: //cdn.jsdelivr.net/npm/pangu@4/dist/browser/pangu.min.js
  # pangu: //cdnjs.cloudflare.com/ajax/libs/pangu/4.0.7/pangu.min.js
  pangu: //lib.baomitu.com/pangu/4.0.7/pangu.min.js

  # Quicklink
  # quicklink: //cdn.jsdelivr.net/npm/quicklink@1/dist/quicklink.umd.js
  quicklink: //lib.baomitu.com/quicklink/latest/quicklink.umd.js

  # DisqusJS
  # disqusjs_js: //cdn.jsdelivr.net/npm/disqusjs@1/dist/disqus.js
  # disqusjs_css: //cdn.jsdelivr.net/npm/disqusjs@1/dist/disqusjs.css
  disqusjs_js: //lib.baomitu.com/disqusjs/latest/disqus.js
  disqusjs_css: //lib.baomitu.com/disqusjs/latest/disqusjs.css

  # Valine
  # valine: //cdn.jsdelivr.net/npm/valine@1/dist/Valine.min.js
  # valine: //cdnjs.cloudflare.com/ajax/libs/valine/1.3.10/Valine.min.js
  valine: //lib.baomitu.com/valine/1.3.10/Valine.min.js

  # Gitalk
  # gitalk_js: //cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js
  # gitalk_css: //cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.css
  gitalk_js: //lib.baomitu.com/gitalk/latest/gitalk.min.js
  gitalk_css: //lib.baomitu.com/gitalk/latest/gitalk.min.css

  # Algolia Search
  # algolia_search: //cdn.jsdelivr.net/npm/algoliasearch@4/dist/algoliasearch-lite.umd.js
  # instant_search: //cdn.jsdelivr.net/npm/instantsearch.js@4/dist/instantsearch.production.min.js
  algolia_search: //lib.baomitu.com/algoliasearch/latest/algoliasearch-lite.umd.js
  instant_search: //lib.baomitu.com/instantsearch.js/latest/instantsearch.production.min.js

  # Mermaid
  # mermaid: //cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js
  # mermaid: //cdnjs.cloudflare.com/ajax/libs/mermaid/8.4.8/mermaid.min.js
  mermaid: //lib.baomitu.com/mermaid/8.4.8/mermaid.min.js

  # Internal version: 1.2.1
  # velocity: //cdn.jsdelivr.net/npm/velocity-animate@1/velocity.min.js
  # velocity: //cdnjs.cloudflare.com/ajax/libs/velocity/1.2.1/velocity.min.js
  # velocity_ui: //cdn.jsdelivr.net/npm/velocity-animate@1/velocity.ui.min.js
  # velocity_ui: //cdnjs.cloudflare.com/ajax/libs/velocity/1.2.1/velocity.ui.min.js
  velocity: //lib.baomitu.com/velocity/1.2.1/velocity.min.js
  velocity_ui: //lib.baomitu.com/velocity/1.2.1/velocity.ui.min.js

  # Internal version: 1.0.2
  # pace: //cdn.jsdelivr.net/npm/pace-js@1/pace.min.js
  # pace: //cdnjs.cloudflare.com/ajax/libs/pace/1.0.2/pace.min.js
  # pace_css: //cdn.jsdelivr.net/npm/pace-js@1/themes/blue/pace-theme-minimal.css
  # pace_css: //cdnjs.cloudflare.com/ajax/libs/pace/1.0.2/themes/blue/pace-theme-minimal.min.css
  pace: //lib.baomitu.com/pace/1.0.2/pace.min.js
  pace_css: //lib.baomitu.com/pace/1.0.2/themes/blue/pace-theme-minimal.min.css

  # Internal version: 1.0.0
  # three: //cdn.jsdelivr.net/gh/theme-next/theme-next-three@1/three.min.js
  # three_waves: //cdn.jsdelivr.net/gh/theme-next/theme-next-three@1/three-waves.min.js
  # canvas_lines: //cdn.jsdelivr.net/gh/theme-next/theme-next-three@1/canvas_lines.min.js
  # canvas_sphere: //cdn.jsdelivr.net/gh/theme-next/theme-next-three@1/canvas_sphere.min.js
  three: 
  three_waves:
  canvas_lines:
  canvas_sphere:

  # Internal version: 1.0.0
  # canvas_ribbon: //cdn.jsdelivr.net/gh/theme-next/theme-next-canvas-ribbon@1/canvas-ribbon.js
  canvas_ribbon:

但是,我始终找不到 theme-next-three 这几个文件,好像是只有 jsd 才有。不知道你有没有解决办法。

谢谢,您给的替换方案可用。我此前尝试过替换的方法,但是一直不完整。

SunJunge08 commented 2 years ago

@code-anan 上面写的不太清楚,我稍微修改了部分 CDN 地址。具体的解决方案如下:

  1. 首先,把 next 目录下的 _config.yml 文件打开,翻到最后,直到你看见了下面几行文字:
#! ---------------------------------------------------------------
#! DO NOT EDIT THE FOLLOWING SETTINGS
#! UNLESS YOU KNOW WHAT YOU ARE DOING
#! See: https://theme-next.org/docs/advanced-settings
#! ---------------------------------------------------------------
  1. 接着,把下面大约123行的内容替换成下面的代码:
# Script Vendors. Set a CDN address for the vendor you want to customize.
# Be aware that you would better use the same version as internal ones to avoid potential problems.
# Remember to use the https protocol of CDN files when you enable https on your site.
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
  # plugins: loli
  plugins: local

  # Internal version: 3.1.0
  # anime: //cdn.jsdelivr.net/npm/animejs@3.1.0/lib/anime.min.js
  anime: //lib.baomitu.com/animejs/3.1.0/anime.min.js

  # Internal version: 5.13.0
  # fontawesome: //cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5/css/all.min.css
  # fontawesome: //cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css
  fontawesome: //lib.baomitu.com/font-awesome/5.13.0/css/all.min.css

  # MathJax
  # mathjax: //cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
  mathjax: //lib.baomitu.com/mathjax/latest/es5/tex-mml-chtml.js

  # KaTeX
  # katex: //cdn.jsdelivr.net/npm/katex@0/dist/katex.min.css
  # katex: //cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/katex.min.css
  # copy_tex_js: //cdn.jsdelivr.net/npm/katex@0/dist/contrib/copy-tex.min.js
  # copy_tex_css: //cdn.jsdelivr.net/npm/katex@0/dist/contrib/copy-tex.min.css
  katex: //lib.baomitu.com/KaTeX/0.15.3/katex.min.css
  copy_tex_js: //lib.baomitu.com/KaTeX/0.15.3/contrib/copy-tex.min.js
  copy_tex_css: //lib.baomitu.com/KaTeX/0.15.3/contrib/copy-tex.min.css

  # Internal version: 0.2.8
  # pjax: //cdn.jsdelivr.net/gh/theme-next/theme-next-pjax@0/pjax.min.js
  pjax: //cdn.staticfile.org/next-theme-pjax/0.4.0/pjax.min.js

  # FancyBox
  # jquery: //cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js
  # fancybox: //cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.js
  # fancybox_css: //cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.css
  jquery: //lib.baomitu.com/jquery/latest/jquery.min.js
  fancybox: //lib.baomitu.com/fancybox/latest/jquery.fancybox.min.js
  fancybox_css: //lib.baomitu.com/fancybox/latest/jquery.fancybox.min.css

  # Medium-zoom
  # mediumzoom: //cdn.jsdelivr.net/npm/medium-zoom@1/dist/medium-zoom.min.js
  mediumzoom: //cdn.bootcdn.net/ajax/libs/medium-zoom/1.0.6/medium-zoom.min.js

  # Lazyload
  # lazyload: //cdn.jsdelivr.net/npm/lozad@1/dist/lozad.min.js
  # lazyload: //cdnjs.cloudflare.com/ajax/libs/lozad.js/1.14.0/lozad.min.js
  lazyload: //lib.baomitu.com/lozad.js/1.14.0/lozad.min.js

  # Pangu
  # pangu: //cdn.jsdelivr.net/npm/pangu@4/dist/browser/pangu.min.js
  # pangu: //cdnjs.cloudflare.com/ajax/libs/pangu/4.0.7/pangu.min.js
  pangu: //lib.baomitu.com/pangu/4.0.7/pangu.min.js

  # Quicklink
  # quicklink: //cdn.jsdelivr.net/npm/quicklink@1/dist/quicklink.umd.js
  quicklink: //lib.baomitu.com/quicklink/latest/quicklink.umd.js

  # DisqusJS
  # disqusjs_js: //cdn.jsdelivr.net/npm/disqusjs@1/dist/disqus.js
  # disqusjs_css: //cdn.jsdelivr.net/npm/disqusjs@1/dist/disqusjs.css
  disqusjs_js: //lib.baomitu.com/disqusjs/latest/disqus.js
  disqusjs_css: //lib.baomitu.com/disqusjs/latest/disqusjs.css

  # Valine
  # valine: //cdn.jsdelivr.net/npm/valine@1/dist/Valine.min.js
  # valine: //cdnjs.cloudflare.com/ajax/libs/valine/1.3.10/Valine.min.js
  valine: //lib.baomitu.com/valine/1.3.10/Valine.min.js

  # Gitalk
  # gitalk_js: //cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js
  # gitalk_css: //cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.css
  gitalk_js: //lib.baomitu.com/gitalk/latest/gitalk.min.js
  gitalk_css: //lib.baomitu.com/gitalk/latest/gitalk.min.css

  # Algolia Search
  # algolia_search: //cdn.jsdelivr.net/npm/algoliasearch@4/dist/algoliasearch-lite.umd.js
  # instant_search: //cdn.jsdelivr.net/npm/instantsearch.js@4/dist/instantsearch.production.min.js
  algolia_search: //lib.baomitu.com/algoliasearch/latest/algoliasearch-lite.umd.js
  instant_search: //lib.baomitu.com/instantsearch.js/latest/instantsearch.production.min.js

  # Mermaid
  # mermaid: //cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js
  # mermaid: //cdnjs.cloudflare.com/ajax/libs/mermaid/8.4.8/mermaid.min.js
  mermaid: //lib.baomitu.com/mermaid/8.4.8/mermaid.min.js

  # Internal version: 1.2.1
  # velocity: //cdn.jsdelivr.net/npm/velocity-animate@1/velocity.min.js
  # velocity: //cdnjs.cloudflare.com/ajax/libs/velocity/1.2.1/velocity.min.js
  # velocity_ui: //cdn.jsdelivr.net/npm/velocity-animate@1/velocity.ui.min.js
  # velocity_ui: //cdnjs.cloudflare.com/ajax/libs/velocity/1.2.1/velocity.ui.min.js
  velocity: //lib.baomitu.com/velocity/1.2.1/velocity.min.js
  velocity_ui: //lib.baomitu.com/velocity/1.2.1/velocity.ui.min.js

  # Internal version: 1.0.2
  # pace: //cdn.jsdelivr.net/npm/pace-js@1/pace.min.js
  # pace: //cdnjs.cloudflare.com/ajax/libs/pace/1.0.2/pace.min.js
  # pace_css: //cdn.jsdelivr.net/npm/pace-js@1/themes/blue/pace-theme-minimal.css
  # pace_css: //cdnjs.cloudflare.com/ajax/libs/pace/1.0.2/themes/blue/pace-theme-minimal.min.css
  pace: //lib.baomitu.com/pace/1.0.2/pace.min.js
  pace_css: //lib.baomitu.com/pace/1.0.2/themes/blue/pace-theme-minimal.min.css

  # Internal version: 1.0.0
  # three: //cdn.jsdelivr.net/gh/theme-next/theme-next-three@1/three.min.js
  # three_waves: //cdn.jsdelivr.net/gh/theme-next/theme-next-three@1/three-waves.min.js
  # canvas_lines: //cdn.jsdelivr.net/gh/theme-next/theme-next-three@1/canvas_lines.min.js
  # canvas_sphere: //cdn.jsdelivr.net/gh/theme-next/theme-next-three@1/canvas_sphere.min.js
  three: 
  three_waves:
  canvas_lines:
  canvas_sphere:

  # Internal version: 1.0.0
  # canvas_ribbon: //cdn.jsdelivr.net/gh/theme-next/theme-next-canvas-ribbon@1/canvas-ribbon.js
  canvas_ribbon: 
  1. 保存文件,然后 hexo g 和 hexo s,就会发现,博客中的内容又能重新显示出来了。

注意事项:

  1. 最后的 three.min.js three-waves.min.js canvas_lines.min.js canvas_sphere.min.js canvas-ribbon.js 这几个文件应该是 jsdelivr 才有,我翻了各大资源托管库都没找到能够作为替代的。

我用梯子上 jsdelivr 把这几个文件下载下来了,但是不知道怎么才能像 https://github.com/theme-next/hexo-theme-next/issues/1707#issuecomment-1132839883 那样,“把依赖的文件下载到本地,再部署到其他 CDN 上”。如果需要的话,我把这几个文件打包下来,可以在这里下载:

jsdelivr.zip

如果你知道怎么“部署到其他 CDN 上”,请告诉我一下怎么做。

  1. 我在使用过程中,发现 MathJax 的显示出了点问题,比如 f(x) 的二阶导数 f''(x) ,就会变成这样:

image

我目前用的是最新版的 MathJax 静态资源,推测降级可以解决这一问题,还有待测试,测试好之后我会写到这个 issue 中。

如果你根本不用 MathJax ,那这一条请直接忽略。

  1. 修改 _config,yml 文件后,我的博客页面基本没有什么问题,但是我不能保证别人的都能正常显示。如果还有关于这方面的问题,请自行解决。
freedomgod commented 2 years ago

next在8.9.0版本开始是支持自定义cdn了,方法就是设置next/_config.yml文件下的vendors中的plugins选项为custom,修改custom_cdn_url。 可以参考jsdelivr被墙,hexo-next切换为自定义CDN

SunJunge08 commented 2 years ago

next在8.9.0版本开始是支持自定义cdn了,方法就是设置next/_config.yml文件下的vendors中的plugins选项为custom,修改custom_cdn_url。 可以参考jsdelivr被墙,hexo-next切换为自定义CDN

我测试了一下,把 vendors 下面的 CDN 地址都删掉,然后修改 plugins 和 custom_cdn_url 结果 hexo s 后的页面又是什么都显示不出来……所以这个方法貌似并没有用。

SunJunge08 commented 2 years ago

jsdelivr 复活力(喜 不需要用 lib.baomitu.com 了。