hexo遇到的异常


  • YAMLException: can not read a block mapping entry; a multiline key may not be an implicit key at line 5, column 1:

解决:文章最前面的分类,标签等,冒号后面需要一个空格且三个下划线不能丢失

  • 突然github上的hexo打不开

    解决:可能是网络原因,重连网络

  • gitalk评论时显示gitalk Error: Validation Failed

    原因:我也碰到了这个问题,研究了一下,发现是文章名称经URL编码后添加到issues的label里,但是label的长度上限是50个字符,所以文章名有些长的都会生成label失败,也就没办法评论了。提一下个人想法,不知道行不行得通:文章名经URL编码后转MD5,然后再生成label,这样就不会超过长度了,也存在区分度

    解决:

    法一:

    下载这个,把里面的md5.min.js放到source\js\src目录中

    修改gitalk.swig文件的中间内容为:

    法二:通过其他的查询只需要在gitalk.swig文件里的clientID上面添加一行id: decodeURL(‘‘),就可以了(应该是通过url里的特定段落进行转码,使其变短).

  • hexo文章添加本地图片(网上的url图片可以成功加载)时,在local和github上不显示的问题

解决: 网上有通过安装hexo-asset-image 插件,开启主目录下_config.yml里的post_asset_folder开关,来实现图片上传问题。经过长时间的尝试,不管是用相对路径(在同名文件夹里),绝对路径(images里),还有的说法是hexo-asset-image1.0.0[]版本有问题,换成0.0.5[ https://github.com/CodeFalling/hexo-asset-image –save],但最终都以失败告终。

网上存储图片的方案有CDN服务。比如Cloudinary提供的图片CDN服务,在Cloudinary中上传图片后,会生成对应的url地址,将地址直接拿来引用即可。

  • Please make sure you have the correct access rights
    and the repository exists.FATAL Something’s wrong. Maybe you can find the solution here: https://hexo.io/d ocs/troubleshooting.html

解决:可能是网络原因,网上有说是ssh密匙的原因

  • Connection reset by 192.30.255.112 fatal: Could not read from remote repository. Please make sure y

原因:可能是ssh密匙过期

解决方法


感觉只能解决现象问题,理论才能解决本质问题。

多少都是爱
0%