Once I had the folder of markdown posts, I put them into a _posts directory as per the traditional Jekyll folder structure. close end end transform ( all_files ) Getting Jekyll to work open ( file, "r+" ) contents = blogpost. each require_relative 'downmark_it/downmark_it' all_files = Dir def transform ( all_files ) all_files. %w(active_support rubygems sequel fileutils yaml active_support/inflector). This prints out the markdown after the html, something I wanted to do so I could check it was working. Of course you’ll need to change the directory locations This is the translator.rb script I used to run the posts through the DownMarkit convertor. Like author and publication date) that Jekyll uses as metadata. And it autogenerated not just formatting but the front-matter (key: value headings for attributes I had to tidy up the resulting markdown files, but this proved to be a godsend, because it was a fairly quick way I used the gem Downmarkit to load in the html posts and turn out text formatted in markdown, Wordpress allows you to export all your posts and metadata, but they come out in a zip file surrounded by a lot of junk html. Though I didn’t follow all of its recommendations. This blog about how to migrate from wordpress to jekyll was a helpful reference. There weren’t loads of posts but I wanted to transfer them and all the metadata. The first step was to grab the old content. Getting stuff out of Wordpress and cleaning the junk off it The code, the pitfalls and some of the emotions I felt on my journey. Sinatra, using the ruby-based blog creator Jekyll. So I pulled the content off the old wordpress template I’d had it on, and built a custom website in the ruby framework How hard it was to change the CSS, and I wanted a domain where I could easily host other code projects. My wordpress site had been running since 2012, I was getting a bit fed up with New site: Loading Jekyll on Sinatra and deploying on Heroku
0 Comments
Leave a Reply. |