Permalinks which end in a slash should always output HTML

Duplicates #4493 for 3.1.1.

/cc @jekyll/core
This commit is contained in:
Parker Moore 2016-02-19 15:00:28 -08:00
parent 3b93625a8f
commit d929242e2b
6 changed files with 17 additions and 4 deletions

View File

@ -217,8 +217,11 @@ module Jekyll
def destination(base_directory)
dest = site.in_dest_dir(base_directory)
path = site.in_dest_dir(dest, URL.unescape_path(url))
path = File.join(path, "index.html") if url.end_with?("/")
if url.end_with? "/"
path = File.join(path, "index.html")
else
path << output_ext unless path.end_with? output_ext
end
path
end

View File

@ -0,0 +1,4 @@
---
---
I should be output to `/with.dots/mit/index.html`.

View File

@ -0,0 +1,5 @@
---
permalink: /contacts/humans/
---
I should be output to `/contacts/humans/index.html`.

View File

@ -203,7 +203,7 @@ class TestCollections < JekyllUnitTest
end
should "contain one document" do
assert_equal 3, @collection.docs.size
assert_equal 4, @collection.docs.size
end
should "allow dots in the filename" do

View File

@ -285,7 +285,7 @@ class TestFilters < JekyllUnitTest
assert_equal 2, g["items"].size
when ""
assert g["items"].is_a?(Array), "The list of grouped items for '' is not an Array."
assert_equal 12, g["items"].size
assert_equal 13, g["items"].size
end
end
end

View File

@ -178,6 +178,7 @@ class TestSite < JekyllUnitTest
environment.html
exploit.md
foo.md
humans.txt
index.html
index.html
main.scss