mirror of
https://github.com/jekyll/jekyll.git
synced 2026-01-10 07:28:07 -05:00
@@ -45,6 +45,8 @@ module Jekyll
|
||||
index.htm
|
||||
index.html
|
||||
index.rhtml
|
||||
index.xht
|
||||
index.xhtml
|
||||
index.cgi
|
||||
index.xml
|
||||
index.json
|
||||
|
||||
@@ -140,7 +140,9 @@ module Jekyll
|
||||
end
|
||||
|
||||
def search_index_file(req, res)
|
||||
super || search_file(req, res, ".html")
|
||||
super ||
|
||||
search_file(req, res, ".html") ||
|
||||
search_file(req, res, ".xhtml")
|
||||
end
|
||||
|
||||
# Add the ability to tap file.html the same way that Nginx does on our
|
||||
@@ -149,7 +151,9 @@ module Jekyll
|
||||
|
||||
def search_file(req, res, basename)
|
||||
# /file.* > /file/index.html > /file.html
|
||||
super || super(req, res, "#{basename}.html")
|
||||
super ||
|
||||
super(req, res, "#{basename}.html") ||
|
||||
super(req, res, "#{basename}.xhtml")
|
||||
end
|
||||
|
||||
# rubocop:disable Naming/MethodName
|
||||
|
||||
1
test/fixtures/webrick/bar/foo.xhtml
vendored
Normal file
1
test/fixtures/webrick/bar/foo.xhtml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">Content of foo.xhtml</html>
|
||||
@@ -34,5 +34,15 @@ class TestCommandsServeServlet < JekyllUnitTest
|
||||
assert_equal("404", response.code)
|
||||
end
|
||||
end
|
||||
|
||||
should "find xhtml file" do
|
||||
get("/bar/foo") do |response|
|
||||
assert_equal("200", response.code)
|
||||
assert_equal(
|
||||
'<html xmlns="http://www.w3.org/1999/xhtml">Content of foo.xhtml</html>',
|
||||
response.body.strip
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user