How much am I loving Hexo right now? I’m actually blogging again!
Turns out that working with blog posts in plain text is just so much more convenient (and fun) than messing about with databases. And having Markdown preview built into VSCode is just even more to love! (but will leave my VSCode fan-bois-ism for another post - such a great editor)…
One thing I noticed in the Wordpress to Hexo migration was that a few of my Wordpress blog posts errored out in the conversion. This morning I had a dig to see what’s going on.
flickr photo shared by “Cowboy” Ben Alman under a Creative Commons ( BY-NC-ND ) license
First, this is the error you might end up with when converting from Wordpress:
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
YAMLException: can not read a block mapping entry; a multiline key may not be an implicit key at line 2, column 5:
date: 2010-07-02 22:54:00
^
at generateError (C:\data\web\blog\node_modules\hexo\node_modules\js-yaml\lib\js-yaml\loader.js:160:10)
at throwError (C:\data\web\blog\node_modules\hexo\node_modules\js-yaml\lib\js-yaml\loader.js:166:9)
at readBlockMapping (C:\data\web\blog\node_modules\hexo\node_modules\js-yaml\lib\js-yaml\loader.js:1027:9)
at composeNode (C:\data\web\blog\node_modules\hexo\node_modules\js-yaml\lib\js-yaml\loader.js:1315:12)
at readDocument (C:\data\web\blog\node_modules\hexo\node_modules\js-yaml\lib\js-yaml\loader.js:1478:3)
at loadDocuments (C:\data\web\blog\node_modules\hexo\node_modules\js-yaml\lib\js-yaml\loader.js:1538:5)
at Object.load (C:\data\web\blog\node_modules\hexo\node_modules\js-yaml\lib\js-yaml
...
YAMLException? Block mapping entry? js-yaml?
Turns out this is because the Wordpress import into Hexo (well, the JS-YAML part, anyway), is not happy being fed quoted entries from your Wordpress exported XML. Finally found a forum post that discusses it.
In my case it was an item like this that was causing the issue:
<title>Netbeans and solving the dreaded "unrecognized project; missing plug-in?"</title>
Notice those quotes? Yes, well. That’s our problem. Remove those guys and your Hexo migrate script will run just fine.
Seems I might still have one more issue with the odd truncated post in lists. But it’s all text, so I should be able to track it down with a Regexp!
Just loving this text-based blogging..