From 69018c5a7cb8666dd77ddf12ec7c9282b6044297 Mon Sep 17 00:00:00 2001 From: Wesley Moore Date: Fri, 12 Mar 2010 07:28:12 +1100 Subject: [PATCH] Put drafts into a drafts folder when importing --- importer/wordpress.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/importer/wordpress.rb b/importer/wordpress.rb index 04c99e2..6577a70 100644 --- a/importer/wordpress.rb +++ b/importer/wordpress.rb @@ -121,10 +121,11 @@ module Importer attributes[:slug] = attributes[:title].downcase.gsub(/[^0-9a-zA-Z]/, '-').gsub(/-{2,}/, '-') end - path = ['', attributes[:section], post_date.year, ("%02d" % post_date.month), attributes[:slug], ''].join('/') - - # require 'pp' - # pp attributes + if attributes[:status] == 'draft' + path = ['', 'drafts', attributes[:slug], ''].join('/') + else + path = ['', attributes[:section], post_date.year, ("%02d" % post_date.month), attributes[:slug], ''].join('/') + end add_item(content, attributes, path) end