Add json extension to list of directory indices (#6550)

Merge pull request 6550
This commit is contained in:
Aaron D Borden 2017-11-13 13:30:23 -08:00 committed by jekyllbot
parent 5cb8a0e847
commit 707a8c7a0e
1 changed files with 10 additions and 7 deletions

View File

@ -17,6 +17,15 @@ module Jekyll
"Skips the initial site build which occurs before the server is started.",], "Skips the initial site build which occurs before the server is started.",],
}.freeze }.freeze
DIRECTORY_INDEX = %w(
index.htm
index.html
index.rhtml
index.cgi
index.xml
index.json
).freeze
# #
def init_with_program(prog) def init_with_program(prog)
@ -85,13 +94,7 @@ module Jekyll
:StartCallback => start_callback(opts["detach"]), :StartCallback => start_callback(opts["detach"]),
:BindAddress => opts["host"], :BindAddress => opts["host"],
:Port => opts["port"], :Port => opts["port"],
:DirectoryIndex => %w( :DirectoryIndex => DIRECTORY_INDEX,
index.htm
index.html
index.rhtml
index.cgi
index.xml
),
} }
opts[:DirectoryIndex] = [] if opts[:JekyllOptions]["show_dir_listing"] opts[:DirectoryIndex] = [] if opts[:JekyllOptions]["show_dir_listing"]