forked from wezm/wezm.net
Put drafts into a drafts folder when importing
This commit is contained in:
parent
fbb6df8758
commit
69018c5a7c
1 changed files with 5 additions and 4 deletions
|
@ -121,10 +121,11 @@ module Importer
|
||||||
attributes[:slug] = attributes[:title].downcase.gsub(/[^0-9a-zA-Z]/, '-').gsub(/-{2,}/, '-')
|
attributes[:slug] = attributes[:title].downcase.gsub(/[^0-9a-zA-Z]/, '-').gsub(/-{2,}/, '-')
|
||||||
end
|
end
|
||||||
|
|
||||||
path = ['', attributes[:section], post_date.year, ("%02d" % post_date.month), attributes[:slug], ''].join('/')
|
if attributes[:status] == 'draft'
|
||||||
|
path = ['', 'drafts', attributes[:slug], ''].join('/')
|
||||||
# require 'pp'
|
else
|
||||||
# pp attributes
|
path = ['', attributes[:section], post_date.year, ("%02d" % post_date.month), attributes[:slug], ''].join('/')
|
||||||
|
end
|
||||||
|
|
||||||
add_item(content, attributes, path)
|
add_item(content, attributes, path)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue