Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Patch for Typo migrator to support extended posts and posts without slugs #526

wants to merge 1 commit into
Jump to file or symbol
Failed to load files and symbols.
+10 −0
@@ -13,6 +13,7 @@ module Typo
c.title title,
c.permalink slug,
c.body body,
+ c.extended extended,
c.published_at date,
c.state state,
COALESCE(tf.name, 'html') filter
@@ -27,6 +28,15 @@ def self.process dbname, user, pass, host='localhost'
db[SQL].each do |post|
next unless post[:state] =~ /published/
+ if(post[:slug] == nil) then
+ post[:slug] = "no slug"
+ end
+ if(post[:extended]) then
+ post[:body] << "\n<!-- more -->\n"
+ post[:body] << post[:extended]
+ end
name = [ sprintf("%.04d", post[:date].year),
sprintf("%.02d", post[:date].month),
sprintf("%.02d", post[:date].day),