From 6826317e00fac0adbbe80ee341fea3eaaaa3e2e0 Mon Sep 17 00:00:00 2001 From: Stephen McDonald Date: Sun, 20 Nov 2011 22:09:43 +1100 Subject: [PATCH] Use the post's title for the filename rather than its ID, as per Jekyll's naming convention. --- lib/jekyll/migrators/tumblr.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll/migrators/tumblr.rb b/lib/jekyll/migrators/tumblr.rb index 602f4169..97105eb4 100644 --- a/lib/jekyll/migrators/tumblr.rb +++ b/lib/jekyll/migrators/tumblr.rb @@ -72,7 +72,7 @@ module Jekyll content << CGI::unescapeHTML(post.at("video-caption").inner_html) unless post.at("video-caption") == nil end # End post types - name = "#{Date.parse(post['date']).to_s}-#{post['id'].downcase.gsub(/[^a-z0-9]/, '-')}.html" + name = "#{Date.parse(post['date']).to_s}-#{title.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')}.#{format}" if title != nil || content != nil && name != nil File.open("_posts/tumblr/#{name}", "w") do |f|