return correct file in dir if dir has same name as file (#6569)

Merge pull request 6569
This commit is contained in:
Florian Thomas
2017-11-24 08:49:13 +00:00
committed by jekyllbot
parent c7c31e014c
commit 368fa1f723
5 changed files with 99 additions and 1 deletions

View File

@@ -18,13 +18,17 @@ module Jekyll
super
end
def search_index_file(req, res)
super || search_file(req, res, ".html")
end
# Add the ability to tap file.html the same way that Nginx does on our
# Docker images (or on GitHub Pages.) The difference is that we might end
# up with a different preference on which comes first.
def search_file(req, res, basename)
# /file.* > /file/index.html > /file.html
super || super(req, res, ".html") || super(req, res, "#{basename}.html")
super || super(req, res, "#{basename}.html")
end
# rubocop:disable Naming/MethodName