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:
Alfred Xing 2014-09-13 17:23:40 -07:00
parent 95644a844f
commit 3a96d01e4a
2 changed files with 2 additions and 2 deletions

View File

@ -269,7 +269,7 @@ module Jekyll
def destination(dest)
# The url needs to be unescaped in order to preserve the correct filename
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
end

View File

@ -589,7 +589,7 @@ class TestPost < Test::Unit::TestCase
should "write properly without html extension" do
post = setup_post("2008-10-18-foo-bar.textile")
post.site.permalink_style = ":title"
post.site.permalink_style = ":title/"
do_render(post)
post.write(dest_dir)