Browse files

Allow setting default mimetype for --server. Useful if permalinks don…

…'t end in .html
  • Loading branch information...
1 parent b3634b5 commit 2f9d4f5be623f37ca79adf84de83fcc3a1c757d6 @RJ committed Feb 5, 2011
Showing with 7 additions and 0 deletions.
  1. +7 −0 bin/jekyll
View
7 bin/jekyll
@@ -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'],

0 comments on commit 2f9d4f5

Please sign in to comment.