17 October 2013
After releasing Ghost to the public I downloaded the published version and ran it on my local machine. Ghost is based on Nodejs, which I’m already familiar, so using npm and forever to run it was not much of a problem. After playing around with the admin interface for a bit I decided to research ways to migrate from Jekyll to Ghost.
Both blog platforms are using Markdown when you edit posts, so I figured it wouldn’t be too hard to convert the files. Unfortunately, Ghost is quite silent when it comes to documentation about their APIs or the import/export formats. I tried to come up with my own nodejs module to import files, but quickly discovered the great Jekyll plugin Jekyll-To-Ghost.
All you have to do is
After your site is generated, you have a file _site/ghost-exported.json with all your posts in an acceptable JSON format which you can import into your installation of Ghost via http://yourdomain:2368/ghost/debug/.
I forked and modified the plugin a bit to convert links generated by the tag post_url into hard relative links (Ghost doesn’t support custom URL formats yet) and fixed the conversion of timestamps which was broken for me.
After importing all my posts I decided to run my own theme, so I copied the default theme casper and made some changes to it. Next would be to modify the theme and add Disqus for comments. I’m curious how the migration for the comments goes along, because I have to modify the identifiers in Disqus to use the new URL structure too.