Export Your Markdown Posts from Jekyll to Ghost

Want to export your Markdown posts from Jekyll to a format that can be easily imported into Ghost, now that the new blogging platform has launched? By reverse-engineering the plugin the Ghost developers made for WordPress, I put together a Jekyll plugin that generates a JSON file that follows the same format. (This was all done in advance of the public release, so it’s untested super-beta software. Hopefully it will work for you without issue!)

  1. Clone the repo and drop the jekylltoghost.rb file into your Jekyll site’s _plugins directory.
  2. Run jekyll build.
  3. There should now be a ghost_export.json file in your _site directory, which you can copy and import into Ghost.

To import the JSON file, you just need to visit http://example.org/ghost/debug/ in your browser and look for the Import section.

Of course, this plugin is fairly limited. Both because of the simplistic nature of the original WordPress plugin I used as a guide, and because Ghost itself is brand-new and has many unimplemented features. This is pretty much just the posts, tags/categories and standard YAML front matter. Enough to get your words into Ghost, with the same permalinks and publication dates. Images will have to be dealt with manually, at least for the time being. (Basically, you just need to copy them from your Jekyll site to the appropriate folder in your Ghost installation and manually fix the paths in the posts.) But, hey, it’s open source. Fork it and hack away!

Jekyll-to-Ghost Exporter [GitHub]