diff --git a/lib/jekyll/migrators/tumblr.rb b/lib/jekyll/migrators/tumblr.rb index b44c0140..bbb7ae16 100644 --- a/lib/jekyll/migrators/tumblr.rb +++ b/lib/jekyll/migrators/tumblr.rb @@ -34,7 +34,6 @@ module Jekyll post[:content] = html_to_markdown post[:content] post[:content] = add_syntax_highlights post[:content] if add_highlights end - post[:name] = truncate_post_name post[:name] if post[:name].size > 255 File.open("_posts/tumblr/#{post[:name]}", "w") do |f| f.puts post[:header].to_yaml + "---\n" + post[:content] end @@ -43,11 +42,6 @@ module Jekyll private - def self.truncate_post_name name - post = name.match(/^(.+)\.(.+)$/).captures - post[0][0..(-1 - post[1].size)] + post[1].size - end - # Converts each type of Tumblr post to a hash with all required # data for Jekyll. def self.post_to_hash(post, format) @@ -103,6 +97,7 @@ module Jekyll date = Date.parse(post['date']).to_s title = Nokogiri::HTML(title).text slug = title.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '') + slug = slug.slice(0..200) if slug.length > 200 { :name => "#{date}-#{slug}.#{format}", :header => {