Fixed Tumblr URL redirects.
This commit is contained in:
parent
886b9740f2
commit
3ab7658d1f
|
@ -110,6 +110,9 @@ module Jekyll
|
||||||
site = Jekyll::Site.new(Jekyll.configuration({}))
|
site = Jekyll::Site.new(Jekyll.configuration({}))
|
||||||
dir = File.join(File.dirname(__FILE__), "..")
|
dir = File.join(File.dirname(__FILE__), "..")
|
||||||
urls = Hash[posts.map { |post|
|
urls = Hash[posts.map { |post|
|
||||||
|
# Create an initial empty file for the post so that
|
||||||
|
# we can instantiate a post object.
|
||||||
|
File.open("_posts/tumblr/#{post[:name]}", "w")
|
||||||
tumblr_url = URI.parse(post[:slug]).path
|
tumblr_url = URI.parse(post[:slug]).path
|
||||||
jekyll_url = Jekyll::Post.new(site, dir, "", "tumblr/" + post[:name]).url
|
jekyll_url = Jekyll::Post.new(site, dir, "", "tumblr/" + post[:name]).url
|
||||||
redirect_dir = tumblr_url.sub(/\//, "") + "/"
|
redirect_dir = tumblr_url.sub(/\//, "") + "/"
|
||||||
|
|
Loading…
Reference in New Issue