Permalink
Browse files

allow --mime config option which loads mime table from Apache compati…

…ble mime.types file

sample usage: `jekyll --server --mime /private/etc/apache2/mime.types`
  • Loading branch information...
1 parent 3fa9af1 commit 31d395ece6675e55d0f646fec3e646086b37e3c2 @darwin committed Sep 20, 2010
Showing with 10 additions and 2 deletions.
  1. +10 −2 bin/jekyll
View
12 bin/jekyll
@@ -82,6 +82,10 @@ opts = OptionParser.new do |opts|
options['url'] = url
end
+ opts.on("--mime [PATH]", "Load custom Apache compatible mime.types file.") do |path|
+ options['mime'] = path
+ end
+
opts.on("--version", "Display current version") do
puts "Jekyll " + Jekyll::VERSION
exit 0
@@ -161,8 +165,12 @@ if options['server']
FileUtils.mkdir_p(destination)
- mime_types = WEBrick::HTTPUtils::DefaultMimeTypes
- mime_types.store 'js', 'application/javascript'
+ unless options['mime']
+ mime_types = WEBrick::HTTPUtils::DefaultMimeTypes
+ mime_types.store 'js', 'application/javascript'
+ else
+ mime_types = WEBrick::HTTPUtils::load_mime_types(options['mime'])
+ end
s = HTTPServer.new(
:Port => options['server_port'],

0 comments on commit 31d395e

Please sign in to comment.