Make permalink parsing consistent with pages
Require permalink to end in a slash to write an index file. Addresses #2920.
This commit is contained in:
parent
95644a844f
commit
3a96d01e4a
|
@ -269,7 +269,7 @@ module Jekyll
|
||||||
def destination(dest)
|
def destination(dest)
|
||||||
# The url needs to be unescaped in order to preserve the correct filename
|
# The url needs to be unescaped in order to preserve the correct filename
|
||||||
path = Jekyll.sanitized_path(dest, URL.unescape_path(url))
|
path = Jekyll.sanitized_path(dest, URL.unescape_path(url))
|
||||||
path = File.join(path, "index.html") if path[/\.html?$/].nil?
|
path = File.join(path, "index.html") if self.url =~ /\/$/
|
||||||
path
|
path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -589,7 +589,7 @@ class TestPost < Test::Unit::TestCase
|
||||||
|
|
||||||
should "write properly without html extension" do
|
should "write properly without html extension" do
|
||||||
post = setup_post("2008-10-18-foo-bar.textile")
|
post = setup_post("2008-10-18-foo-bar.textile")
|
||||||
post.site.permalink_style = ":title"
|
post.site.permalink_style = ":title/"
|
||||||
do_render(post)
|
do_render(post)
|
||||||
post.write(dest_dir)
|
post.write(dest_dir)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue