mirror of
https://github.com/jekyll/jekyll.git
synced 2026-01-30 09:18:11 -05:00
Allow setting default mimetype for --server. Useful if permalinks don't end in .html
This commit is contained in:
@@ -44,6 +44,10 @@ opts = OptionParser.new do |opts|
|
||||
options['baseurl'] = baseurl
|
||||
end
|
||||
|
||||
opts.on("--default-mimetype [MT]", "Mimetype to use when no file extension (if --server)") do |mt|
|
||||
options['default-mimetype'] = mt
|
||||
end
|
||||
|
||||
opts.on("--[no-]lsi", "Use LSI for better related posts") do |lsi|
|
||||
options['lsi'] = lsi
|
||||
end
|
||||
@@ -177,6 +181,9 @@ if options['server']
|
||||
|
||||
mime_types = WEBrick::HTTPUtils::DefaultMimeTypes
|
||||
mime_types.store 'js', 'application/javascript'
|
||||
if options['default-mimetype']
|
||||
mime_types.store nil, options['default-mimetype']
|
||||
end
|
||||
|
||||
s = HTTPServer.new(
|
||||
:Port => options['server_port'],
|
||||
|
||||
Reference in New Issue
Block a user