Hexo(十):使用中的问题

常见问题

Template render error

解析异常,通常在hexo g的时候出现,通常是某些代码被解析

1
2
Template render error: (unknown path)
Error: template not found: ./comments/livere.swig

如果让jekyll不解析,使用raw语法,中间写内容

1
2
3
4
5
6

{% raw %}

{% sometag %}

{% endraw %}

Found incompatible module

使用yarn管理依赖

1
error nunjucks@3.1.3: The engine "node" is incompatible with this module. Expected version ">= 6.9.0 <= 11.0.0-0". Got "11.0.0"

需要将node降级为7,在travis.yml中修改

1
2
# node版本
node_js: "7"

gitalk授权问题

使用github issue实现hexo评论功能,登陆时无法跳转到有效链接

解决办法:检查MD文件名称中是否有中文字符,例如:中文冒号:,如果有去掉即可,因为跳转时会转换成英文字符,所以路径就找不到,空格也可能有问题