0%

hexo 模版渲染错误

在写完一篇关于 shell 语法的笔记后,hexo g 生成网页时报错,错误如下:

1
2
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Template render error: (unknown path)

进入给出的链接 , 可能是_config.yml 文件或新的 post/page 有语法错误,但不确定是哪篇文章

参考 https://github.com/hexojs/hexo/issues/1837, 可以通过 hexo g --debug 定位出错的文章

最后通过不断二分定位了文章中出错的地方,是一句 bash 命令:

1
echo ${!#}

总之,以后比较特殊的字符和命令还是用 ``` 进行包裹比较好

Thank you for your reward !