Merge commit '6bfaa6'
This commit is contained in:
		
						commit
						a90f9cd8b0
					
				|  | @ -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 | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										22
									
								
								bin/jekyll
								
								
								
								
							
							
						
						
									
										22
									
								
								bin/jekyll
								
								
								
								
							|  | @ -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' | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue