1
0
Fork 0
forked from wezm/wezm.net

Put drafts into a drafts folder when importing

This commit is contained in:
Wesley Moore 2010-03-12 07:28:12 +11:00
parent fbb6df8758
commit 69018c5a7c

View file

@ -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