Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…'t end in .html
  • Loading branch information...
commit 2f9d4f5be623f37ca79adf84de83fcc3a1c757d6 1 parent b3634b5
Richard Jones authored

Showing 1 changed file with 7 additions and 0 deletions. Show diff stats Hide diff stats

  1. +7 0 bin/jekyll
7 bin/jekyll
@@ -44,6 +44,10 @@ opts = OptionParser.new do |opts|
44 44 options['baseurl'] = baseurl
45 45 end
46 46
  47 + opts.on("--default-mimetype [MT]", "Mimetype to use when no file extension (if --server)") do |mt|
  48 + options['default-mimetype'] = mt
  49 + end
  50 +
47 51 opts.on("--[no-]lsi", "Use LSI for better related posts") do |lsi|
48 52 options['lsi'] = lsi
49 53 end
@@ -177,6 +181,9 @@ if options['server']
177 181
178 182 mime_types = WEBrick::HTTPUtils::DefaultMimeTypes
179 183 mime_types.store 'js', 'application/javascript'
  184 + if options['default-mimetype']
  185 + mime_types.store nil, options['default-mimetype']
  186 + end
180 187
181 188 s = HTTPServer.new(
182 189 :Port => options['server_port'],

0 comments on commit 2f9d4f5

Please sign in to comment.
Something went wrong with that request. Please try again.