Skip to content
This repository

Extra options to make mt.rb migrator more flexible #408

Closed
wants to merge 1 commit into from

2 participants

Albert Lash Parker Moore
Albert Lash

The primary reason I use Movable Type is because it supports multiple blogs very well.

Jekyll is awesome and so I'm migrating some to it. This commit makes it easier for me, and potentially others.

Parker Moore
Owner

Added to jekyll/jekyll-import#3. Thanks!

Parker Moore parkr closed this January 30, 2013
Parker Moore parkr referenced this pull request in jekyll/jekyll-import January 30, 2013
Closed

Jekyll PRs #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Sep 26, 2011
Albert Lash making mt.rb migrator more flexible 3cfd745
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. 5  lib/jekyll/migrators/mt.rb
5  lib/jekyll/migrators/mt.rb
@@ -27,12 +27,13 @@ module MT
27 27
                     entry_convert_breaks \
28 28
              FROM mt_entry"
29 29
 
30  
-    def self.process(dbname, user, pass, host = 'localhost')
  30
+    def self.process(dbname, user, pass, host = 'localhost', blog_id = nil)
31 31
       db = Sequel.mysql(dbname, :user => user, :password => pass, :host => host, :encoding => 'utf8')
32 32
 
33 33
       FileUtils.mkdir_p "_posts"
34 34
 
35  
-      db[QUERY].each do |post|
  35
+      q = blog_id.nil? ? QUERY : "#{QUERY} WHERE entry_blog_id = #{blog_id}"
  36
+      db[q].each do |post|
36 37
         title = post[:entry_title]
37 38
         slug = post[:entry_basename].gsub(/_/, '-')
38 39
         date = post[:entry_authored_on]
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.