Merge commit '6bfaa6'

This commit is contained in:
Tom Preston-Werner 2008-12-21 18:08:14 -08:00
commit a90f9cd8b0
2 changed files with 29 additions and 0 deletions

View File

@ -137,6 +137,13 @@ compilation), you must install it (gem install rdiscount) and then you can
have it used instead:
$ jekyll --rdiscount
When previewing complex sites locally, simply opening the site in a web
browser (using file://) can cause problems with links that are relative to
the site root (e.g., "/stylesheets/style.css"). To get around this, Jekyll
can launch a simple WEBrick server (works well in conjunction with --auto):
$ jekyll --server
h2. Data

View File

@ -25,6 +25,10 @@ opts = OptionParser.new do |opts|
options[:auto] = true
end
opts.on("--server", "Run a WEBrick server on destination directory") do
options[:server] = true
end
opts.on("--lsi", "Use LSI for better related posts") do
Jekyll.lsi = true
end
@ -78,6 +82,24 @@ case ARGV.size
exit(1)
end
if options[:server]
require 'webrick'
include WEBrick
s = HTTPServer.new(
:Port => 4000,
:DocumentRoot => destination
)
t = Thread.new {
s.start
}
unless options[:auto]
trap("INT") { s.shutdown }
t.join()
end
end
if options[:auto]
require 'directory_watcher'