1. hexo博客加载时报错‘prism_plugin‘如下

    1
    2
    3
    ERROR Plugin load failed: hexo-prism-plugin
    Error: `prism_plugin` options should be added to _config.yml file

    image-20220620161422139

  2. 换了主题,运行后http://localhost:4000/是一面空白,然后有行字:

    1
    extends includes/layout.pug block content include ./includes/mixins/post-ui.pug #recent-posts.recent

一,

在 hexo 文件目录下的_config.yml的最后加上下面这个(不是主题下面的!是根目录下的)

1
2
3
4
prism_plugin:
mode: 'preprocess' # realtime/preprocess
theme: 'default'
line_number: false # default false

二,

输入:npm install --save hexo-renderer-jade hexo-generator-feed hexo-generator-sitemap hexo-browsersync hexo-generator-archive

然后:hexo clean清理缓存,hexo g再来一次就ok

这里应该是缺少安装pug依赖和渲染插件依赖

从今儿我会记录每天出现的 Bug ,以防忘记。比如这次就是准备换个主题然后出现了很多Bug。我觉得还是得记下来的,不然很快就忘了。哈哈哈哈。

参考:

  1. https://blog.csdn.net/weixin_44318830/article/details/104884936
  2. https://blog.csdn.net/u010250240/article/details/109199248