YAML不熟悉。感觉hexo-migrator-wordpress适配性可能还是存在问题。
在使用命令: $hexo migrate wordpress ~/Downloads/wordpress.2015-08-10.xml
中,报错:
...
INFO Post found: 一份儿借鉴的旅行笔记
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
JS-YAML: can not read a block mapping entry; a multiline key may not be an implicit key at line 2, column 5:
date: 2009-12-25 14:48:45
^
...
具体XML中大致位置:
<xml>
32727 <excerpt:encoded><![CDATA[]]></excerpt:encoded>
32728 <wp:post_id>161</wp:post_id>
32729 <wp:post_date>2009-12-25 22:48:45</wp:post_date>
32730 <wp:post_date_gmt>2009-12-25 14:48:46</wp:post_date_gmt>
32731 <wp:comment_status>open</wp:comment_status>
32732 <wp:ping_status>open</wp:ping_status>
</xml>
其中 46秒 和 45秒 的区别是我特意修改了一次xml用于定位问题的。但是,整个xml文件中现在只有这个位置有跟这个时间点字符串有关的信息。
现在不知道从哪里下手了。
还请各位有经验的同学协助分享一下经验。
JS-YAML在遇到很多问题的时候都会报这个错……但是基本上都跟它标出来的这个位置没什么关系。
先把这篇文章剔除掉然后migrate试一下,如果没问题那有可能是该文章的tag或者标题有问题。如果还有问题可以对比一下出问题的文章跟这篇文章的共同点。
YAML对格式要求很高,空格和半角冒号等符号很容易出问题。平时可以手动加双引号之类的,migrate的时候就比较麻烦。