WARN No layout: index.html

报错信息

hexo博客moho主题安装后 http://localhost:4000/显示的是空白,且报错WARN No layout index.html

报错分析

经查,此为config里theme设置错误引起,运行git clone 指令获得miho主题后,在theme主题下保存文件夹的名称为:miho 而在config里的theme设置的是

1
2
3
4
5
 # Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: miho#
## Docs: https://hexo.io/docs/deployment.html

就会出现这样的WARN。把theme的内容改正为

1
2
3
4
5
 # Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: miho
### Docs: https://hexo.io/docs/deployment.html

之后再次运行

1
2
hexo g
hexo s

就OK

注意

  • config若用window自带的记事本编辑,极为容易出现乱码!!此次就是因为我一开始用记事本做的编辑,结果折腾了老半天才查出是这个问题 T_T
× 请我吃糖~
打赏二维码