hexo 报错 Cannot read property 'replace' of null

开始折腾静态博客,想把网址 https://itcuihao.github.io/itcuihao 换成 https://itcuihao.github.io
于是把原来的 repository name 由 itcuihao 改为 itcuihao.github.io

hexo配置文件进行相应的修改

deploy:
  type: git
  repo: https://github.com/itcuihao/itcuihao.github.io.git
  branch: master

执行命令

hexo g -d

就报错了:

FATAL Cannot read property 'replace' of null

解决:

看帖子都是说 _config.yml 配置文件中的url 设置错误

我的设置:

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://itcuihao.github.io
root: 
permalink: :year/:month/:day/:title/
permalink_defaults:

想了下url应该没有错,那会不会是root设置有问题,于是改成

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://itcuihao.github.io
root: itcuihao.github.io
permalink: :year/:month/:day/:title/
permalink_defaults:

执行 hexo g -d 成功。

参考链接

hexo issues #2006
hexo issues #2141
cd2want

    原文作者:我的名字叫浩仔
    原文地址: https://www.jianshu.com/p/449accb044b4
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞